Skip to content

0.3.0 #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
312f408
1 create npm baseline and modules api (#2)
bubulux Dec 20, 2024
0db1d7f
5 enable storybook development (#9)
bubulux Dec 22, 2024
65c8fd5
Patch for pipeline
bubulux Dec 22, 2024
2bfc40a
Auth patch
bubulux Dec 22, 2024
9832cad
next patch
bubulux Dec 22, 2024
16beabf
Wrong token
bubulux Dec 22, 2024
726278e
Github token as well
bubulux Dec 22, 2024
32f5f74
rm bot req
bubulux Dec 22, 2024
ce4d723
new script
bubulux Dec 22, 2024
5ecbdc0
w dispatch
bubulux Dec 22, 2024
e708a0f
final update
bubulux Dec 22, 2024
ec7e140
6 setup jest (#10)
bubulux Dec 23, 2024
3b0a6ec
7 setup cicd (#11)
bubulux Dec 23, 2024
e5275cd
Merge branch 'production' into development
bubulux Dec 23, 2024
9782687
Fix for pipeline check
bubulux Dec 23, 2024
46d03a8
Merge branch 'production' into development
bubulux Dec 23, 2024
4f96ce1
15 subsequent fixes for cicd (#16)
bubulux Dec 26, 2024
f1a63f9
Updated version for CI/CD Test
bubulux Dec 26, 2024
1d87d8a
4 add consistent flexbox component (#18)
bubulux Dec 26, 2024
1c4e104
8 initial readme file (#19)
bubulux Dec 26, 2024
ddde1ec
First release under unstable branch
bubulux Dec 26, 2024
32f2e29
Update version to 0.1.0
bubulux Dec 26, 2024
b05d756
22 create shallow dist for package (#23)
bubulux Dec 27, 2024
9fc5fdd
Merge branch 'production' into development
bubulux Dec 27, 2024
27e75c3
25 add missing flex properties to flex (#26)
bubulux Dec 28, 2024
092f376
Inc Version to 0.2.1 after Flexbox patches
bubulux Dec 28, 2024
bdf2829
Merge branch 'production' into development
bubulux Dec 28, 2024
7e12f70
duplication
bubulux Dec 30, 2024
8245af0
Merge branch 'production' into development
bubulux Dec 30, 2024
02a2e99
29 add buttongroup (#31)
bubulux Jan 3, 2025
0dfd249
30 add experimentell stateless modal logic for dd enviroments (#32)
bubulux Jan 3, 2025
2c24201
Merge branch 'production' into development
bubulux Jan 3, 2025
d0eb7a7
Versioning fix
bubulux Jan 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false

[*.mk]
indent_style = tab
indent_size = 2

[makefile]
indent_style = tab
indent_size = 2
3 changes: 3 additions & 0 deletions changelog-notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- added fit-content option to Flex
- added role to Flex
- added ButtonGroup
10 changes: 9 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,12 @@ endef

define echo_purple
echo -e ${PURPLE}$1${NC}
endef
endef

git-sync-prod:
@echo "Syncing with prod branch"
git fetch origin production:production

git-sync-dev:
@echo "Syncing with dev branch"
git fetch origin development:development
12 changes: 7 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fluentui-helpers",
"version": "0.2.2",
"version": "0.3.0",
"description": "Helper library for microsofts fluentui react library",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export { ButtonGroup } from "@components/molecules";
export { Flex } from "@components/layout";
3 changes: 3 additions & 0 deletions src/components/layout/Flex/func.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import type {

type TProps = {
children: ReactNode;
role?: string;
position?: TFlexPosition;
direction?: TFlexDirection;
justifyContent?: TFlexOptionContent;
Expand Down Expand Up @@ -124,6 +125,7 @@ export default function Flex({
className = undefined,
testId = undefined,
children,
role = undefined,
...rest
}: TProps) {
const flexBoxClass = useFlexBox(
Expand All @@ -149,6 +151,7 @@ export default function Flex({
// eslint-disable-next-line react/jsx-props-no-spreading
{...ariaProps}
data-testid={testId}
role={role}
className={mergeClasses(
positionClass,
flexBoxClass,
Expand Down
6 changes: 6 additions & 0 deletions src/components/layout/Flex/styles/dimensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const useDimensionClasses = makeStyles({
autoWidth: {
width: "auto",
},
fitContentWidth: {
width: "fit-content",
},
"25%Width": {
width: "25%",
},
Expand All @@ -17,6 +20,9 @@ const useDimensionClasses = makeStyles({
width: "100%",
},

fitContentHeight: {
height: "fit-content",
},
autoHeight: {
height: "auto",
},
Expand Down
12 changes: 6 additions & 6 deletions src/components/layout/Flex/tests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,10 @@ describe("Flex", () => {
const FlexElement = screen.getByText("FlexChild");
expect(FlexElement).toHaveStyle("height: 75%");
});
it("should render with height auto", () => {
render(<Flex shHeight="auto">FlexChild</Flex>);
it("should render with height fitContent", () => {
render(<Flex shHeight="fitContent">FlexChild</Flex>);
const FlexElement = screen.getByText("FlexChild");
expect(FlexElement).toHaveStyle("height: auto");
expect(FlexElement).toHaveStyle("height: fit-content");
});
});
describe("for shWidth", () => {
Expand All @@ -386,10 +386,10 @@ describe("Flex", () => {
const FlexElement = screen.getByText("FlexChild");
expect(FlexElement).toHaveStyle("width: 75%");
});
it("should render with width auto", () => {
render(<Flex shWidth="auto">FlexChild</Flex>);
it("should render with width fitContent", () => {
render(<Flex shWidth="fitContent">FlexChild</Flex>);
const FlexElement = screen.getByText("FlexChild");
expect(FlexElement).toHaveStyle("width: auto");
expect(FlexElement).toHaveStyle("width: fit-content");
});
});
describe("for className", () => {
Expand Down
9 changes: 8 additions & 1 deletion src/components/layout/Flex/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,14 @@ export type TFlexBasis =
| "fitContent"
| "content"
| "0";
export type TFlexShorthandDimensions = "25%" | "50%" | "75%" | "100%" | "auto";

export type TFlexShorthandDimensions =
| "25%"
| "50%"
| "75%"
| "100%"
| "auto"
| "fitContent";

export type TFlexPosition =
| "-moz-initial"
Expand Down
52 changes: 52 additions & 0 deletions src/components/molecules/ButtonGroup/func.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import type { JSX } from "react";

import { Flex } from "@components/layout";
import useButtonGroupClasses from "@components/molecules/ButtonGroup/styles";

type TProps = {
children: JSX.Element[];
ariaLabel?: string;
};

/**
* @description
* - a very simple wrapper to get started with a button group
* - will make sure that the first and last childs borderRadius is preserved
* - while the ones in between are normalized and the border is removed, to avoid double borders
* - all subsequent logic needs to be handled by the consumer, there are examples in the storybook
*
* @hints
* - make sure the buttons are of the same size
* - make sure the buttons on the edges have the same shape
* - make sure that when disabling a Button, you use the `disableFosusable` prop, in order to ensure consistent tab-index order
* - use appearance="primary" for the currently active button and the rest to default "outline"
* - probably use it in a XOR fashion, so that only one button is active at a time
*
* @accessibility
* - in general should not be used for 100% accesibility proof interactions
* - as its not very clear how to indicate the current state to screen readers, because the buttons dont have an active state
*
* @props
* - `children`: expects the Button component, at least two
* - `ariaLabel`: optional, used for accessibility
*
* @default
* arialLabel = "Button group"
*
*/
export default function ButtonGroup({
children,
ariaLabel = "Button group",
}: TProps): JSX.Element {
const classes = useButtonGroupClasses();
return (
<Flex
className={classes.root}
shWidth="fitContent"
role="group"
aria-label={ariaLabel}
>
{children}
</Flex>
);
}
3 changes: 3 additions & 0 deletions src/components/molecules/ButtonGroup/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ButtonGroup from "@components/molecules/ButtonGroup/func";

export default ButtonGroup;
Loading
Loading