@fluentui/react-divider 0.0.0-nightly-20220302-0405.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.json +2384 -0
  2. package/CHANGELOG.md +913 -0
  3. package/LICENSE +15 -0
  4. package/MIGRATION.md +60 -0
  5. package/README.md +23 -0
  6. package/Spec.md +90 -0
  7. package/dist/react-divider.d.ts +66 -0
  8. package/lib/Divider.d.ts +1 -0
  9. package/lib/Divider.js +2 -0
  10. package/lib/Divider.js.map +1 -0
  11. package/lib/components/Divider/Divider.d.ts +6 -0
  12. package/lib/components/Divider/Divider.js +15 -0
  13. package/lib/components/Divider/Divider.js.map +1 -0
  14. package/lib/components/Divider/Divider.types.d.ts +36 -0
  15. package/lib/components/Divider/Divider.types.js +2 -0
  16. package/lib/components/Divider/Divider.types.js.map +1 -0
  17. package/lib/components/Divider/index.d.ts +5 -0
  18. package/lib/components/Divider/index.js +6 -0
  19. package/lib/components/Divider/index.js.map +1 -0
  20. package/lib/components/Divider/renderDivider.d.ts +5 -0
  21. package/lib/components/Divider/renderDivider.js +16 -0
  22. package/lib/components/Divider/renderDivider.js.map +1 -0
  23. package/lib/components/Divider/useDivider.d.ts +8 -0
  24. package/lib/components/Divider/useDivider.js +43 -0
  25. package/lib/components/Divider/useDivider.js.map +1 -0
  26. package/lib/components/Divider/useDividerStyles.d.ts +3 -0
  27. package/lib/components/Divider/useDividerStyles.js +179 -0
  28. package/lib/components/Divider/useDividerStyles.js.map +1 -0
  29. package/lib/index.d.ts +1 -0
  30. package/lib/index.js +2 -0
  31. package/lib/index.js.map +1 -0
  32. package/lib/tsdoc-metadata.json +11 -0
  33. package/lib-commonjs/Divider.d.ts +1 -0
  34. package/lib-commonjs/Divider.js +10 -0
  35. package/lib-commonjs/Divider.js.map +1 -0
  36. package/lib-commonjs/components/Divider/Divider.d.ts +6 -0
  37. package/lib-commonjs/components/Divider/Divider.js +26 -0
  38. package/lib-commonjs/components/Divider/Divider.js.map +1 -0
  39. package/lib-commonjs/components/Divider/Divider.types.d.ts +36 -0
  40. package/lib-commonjs/components/Divider/Divider.types.js +6 -0
  41. package/lib-commonjs/components/Divider/Divider.types.js.map +1 -0
  42. package/lib-commonjs/components/Divider/index.d.ts +5 -0
  43. package/lib-commonjs/components/Divider/index.js +18 -0
  44. package/lib-commonjs/components/Divider/index.js.map +1 -0
  45. package/lib-commonjs/components/Divider/renderDivider.d.ts +5 -0
  46. package/lib-commonjs/components/Divider/renderDivider.js +27 -0
  47. package/lib-commonjs/components/Divider/renderDivider.js.map +1 -0
  48. package/lib-commonjs/components/Divider/useDivider.d.ts +8 -0
  49. package/lib-commonjs/components/Divider/useDivider.js +53 -0
  50. package/lib-commonjs/components/Divider/useDivider.js.map +1 -0
  51. package/lib-commonjs/components/Divider/useDividerStyles.d.ts +3 -0
  52. package/lib-commonjs/components/Divider/useDividerStyles.js +190 -0
  53. package/lib-commonjs/components/Divider/useDividerStyles.js.map +1 -0
  54. package/lib-commonjs/index.d.ts +1 -0
  55. package/lib-commonjs/index.js +10 -0
  56. package/lib-commonjs/index.js.map +1 -0
  57. package/package.json +63 -0
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ @fluentui/react-divider
2
+
3
+ Copyright (c) Microsoft Corporation
4
+
5
+ All rights reserved.
6
+
7
+ MIT License
8
+
9
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
14
+
15
+ Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
package/MIGRATION.md ADDED
@@ -0,0 +1,60 @@
1
+ # Divider Migration
2
+
3
+ ## STATUS: WIP 🚧
4
+
5
+ This Migration guide is a work in progress and is not yet ready for use.
6
+
7
+ ## Migration from v8
8
+
9
+ The existing `Separator` control supports the `content` property as well as children nodes. The `content` property has been removed and now only supports children.
10
+
11
+ With the new converged capabilities, both the `styles` and `theme` properties are no longer supported.
12
+
13
+ Properties that are still available are the `alignContent` and `vertical` with the same acceptable values that are currently defined.
14
+
15
+ ## Migration from v0
16
+
17
+ The v0 Divider is close to the converged Divider. Again, as with the Separator control, the `content` property in the converged component is not supported.
18
+
19
+ Also, from design discussion, the converged component does not support the `size` component as it is redundant as it can be replicated through using the `borderSize` property and if needed, update the `fontSize` property to match desired style.
20
+
21
+ The `fitted` property also is not in use as by default the `Divider` can use the standard `margin` | `marginLeft` | `marginRight` | `marginTop` | `marginBottom` properties to adjust as needed. The default margin for the divider is 0.
22
+
23
+ ## Property mapping
24
+
25
+ | v8 `Separator` | v0 `Divider` | Converged `Divider` |
26
+ | -------------- | ------------ | --------------------- |
27
+ | alignContent | - | alignContent |
28
+ | vertical | vertical | vertical |
29
+ | theme | - | (tokens) |
30
+ | styles | - | (tokens) |
31
+ | - | color | color |
32
+ | - | size | fontSize & borderSize |
33
+ | - | important | important |
34
+ | - | fitted | margin properties |
35
+ | - | - | inset |
36
+ | - | - | borderStyle |
37
+ | - | - | borderSize |
38
+ | - | - | appearance |
39
+
40
+ ## Examples
41
+
42
+ ```
43
+ <Divider content="My Content">
44
+ <Divider>My Content</Divider>
45
+ ```
46
+
47
+ _Note:_ The property theme from the separator control has been removed
48
+
49
+ ```
50
+ <Separator theme={myTheme}>
51
+ <Divider /> /* Handled by the theme provider */
52
+ ```
53
+
54
+ _Note:_ The property styles from the separator control has been removed and now uses the inherent react style mechanics
55
+
56
+ ```
57
+ <Separator styles={myStyles}>
58
+ <Divider style={{ direction:ltr }}/>
59
+ /* Handled by the theme provider / Tokens */
60
+ ```
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # @fluentui/react-divider
2
+
3
+ **React Divider components for [Fluent UI](https://dev.microsoft.com/fluentui)**
4
+
5
+ The Divider component represents a visual separator, that may contain content. A Divider can be vertical or horizontal.
6
+
7
+ ## STATUS: WIP 🚧
8
+
9
+ These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
10
+
11
+ ## Usage
12
+
13
+ To import Divider:
14
+
15
+ ```js
16
+ import { Divider } from '@fluentui/react-divider';
17
+ ```
18
+
19
+ Once the Divider component graduates to a production release, the component will be available at:
20
+
21
+ ```js
22
+ import { Divider } from '@fluentui/react-components';
23
+ ```
package/Spec.md ADDED
@@ -0,0 +1,90 @@
1
+ # Divider Spec
2
+
3
+ ## Background
4
+
5
+ A `Divider` is used to visually segment content into groups.
6
+
7
+ ## Prior Art
8
+
9
+ [Github Epic Convergence Issue #16254](https://github.com/microsoft/fluentui/issues/16254)
10
+
11
+ [Github Convergence Issue #15759](https://github.com/microsoft/fluentui/issues/15759)
12
+
13
+ [Fluent UI Separator](https://developer.microsoft.com/en-us/fluentui#/controls/web/separator)
14
+
15
+ [Open UI Component Matrix](https://open-ui.org/analysis/component-matrix)
16
+
17
+ [Ant Design Divider](https://ant.design/components/divider/)
18
+
19
+ [Fast Divider](https://explore.fast.design/components/fast-divider)
20
+
21
+ [Semantic UI Divider](https://semantic-ui.com/elements/divider.html)
22
+
23
+ ## Comparison of v8 and v0
24
+
25
+ - v8 - [Separator](https://developer.microsoft.com/en-us/fluentui#/controls/web/separator)
26
+ - v0 - [Divider](https://fluentsite.z22.web.core.windows.net/0.52.1/components/divider/definition)
27
+
28
+ ## Sample Code
29
+
30
+ Basic Examples:
31
+
32
+ ```tsx
33
+ <Divider />
34
+ <Divider vertical />
35
+ <Divider>This is a divider with content</Divider>
36
+ ```
37
+
38
+ ## Variants
39
+
40
+ ### Layout
41
+
42
+ The `Divider` component has two layout variants:
43
+
44
+ - The default `Divider` is separates contents by rendering a horizontal line.
45
+ - A `Divider` with the `vertical` prop set to true separates contents by rendering a vertical line.
46
+
47
+ ### Inset
48
+
49
+ A `Divider` with the `inset` prop adds padding to the beginning and end of the component.
50
+
51
+ ### Appearance
52
+
53
+ The `Divider` component has four appearance variants:
54
+
55
+ - The default `Divider` is styled with the neutral foreground color from the theme.
56
+ - appearance="brand": The `Divider` is styled with the brand color from the theme.
57
+ - appearance="strong": The `Divider` is styled with a strong color that emphasizes the visual separation.
58
+ - appearance="subtle": The `Divider` is styled with a subtle color to de-emphasize the visual separation.
59
+
60
+ ## API
61
+
62
+ From [Divider.types.tsx](https://github.com/microsoft/fluentui/blob/master/packages/react-divider/src/components/Divider/Divider.types.ts)
63
+
64
+ ## HTML Structure
65
+
66
+ ```html
67
+ <div>
68
+ <!-- ::before to handle the divider line independent of the divider having content or not -->
69
+ <div>Content</div>
70
+ <!-- ::after to handle the divider line that goes after the content if it has been provided. -->
71
+ </div>
72
+ ```
73
+
74
+ ## Migration
75
+
76
+ [See MIGRATION.md](./Migration.md)
77
+
78
+ ## Behaviors
79
+
80
+ This component has no state.
81
+
82
+ This component has no mouse, touch or keyboard interactions.
83
+
84
+ Content, if provided, will self-determine its behaviors.
85
+
86
+ ## Accessibility
87
+
88
+ - The `Divider` component should be assigned a `role="separator"` by default.
89
+ - The `Divider` component should be named by its content.
90
+ - The `Divider` component should have no other accessibility concerns otherwise. The descendant content in the divider must handle any required accessibility behaviors itself when appropriate.
@@ -0,0 +1,66 @@
1
+ import type { ComponentProps } from '@fluentui/react-utilities';
2
+ import type { ComponentState } from '@fluentui/react-utilities';
3
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
4
+ import * as React_2 from 'react';
5
+ import type { Slot } from '@fluentui/react-utilities';
6
+
7
+ /**
8
+ * A divider visually segments content into groups.
9
+ */
10
+ export declare const Divider: ForwardRefComponent<DividerProps>;
11
+
12
+ export declare const dividerClassName = "fui-Divider";
13
+
14
+ declare type DividerCommons = {
15
+ /**
16
+ * Determines the alignment of the content within the divider.
17
+ * @defaultvalue 'center'
18
+ */
19
+ alignContent: 'start' | 'center' | 'end';
20
+ /**
21
+ * A divider can have one of the preset appearances.
22
+ * When not specified, the divider has its default appearance.
23
+ */
24
+ appearance?: 'brand' | 'strong' | 'subtle';
25
+ /**
26
+ * Adds padding to the beginning and end of the divider.
27
+ * @default false
28
+ */
29
+ inset: boolean;
30
+ /**
31
+ * A divider can be horizontal (default) or vertical.
32
+ * @default false
33
+ */
34
+ vertical: boolean;
35
+ };
36
+
37
+ export declare type DividerProps = ComponentProps<Partial<DividerSlots>> & Partial<DividerCommons>;
38
+
39
+ export declare type DividerSlots = {
40
+ /**
41
+ * Root of the component that renders as a `<div>` tag.
42
+ */
43
+ root: Slot<'div'>;
44
+ /**
45
+ * Accessibility wrapper for content when presented.
46
+ */
47
+ wrapper: Slot<'div'>;
48
+ };
49
+
50
+ export declare type DividerState = ComponentState<DividerSlots> & DividerCommons;
51
+
52
+ /**
53
+ * Renders a Divider component by passing the slot props (defined in `state`) to the appropriate slots.
54
+ */
55
+ export declare const renderDivider_unstable: (state: DividerState) => JSX.Element;
56
+
57
+ /**
58
+ * Returns the props and state required to render the component
59
+ * @param props - User-provided props to the Divider component.
60
+ * @param ref - User-provided ref to be passed to the Divider component.
61
+ */
62
+ export declare const useDivider_unstable: (props: DividerProps, ref: React_2.Ref<HTMLElement>) => DividerState;
63
+
64
+ export declare const useDividerStyles_unstable: (state: DividerState) => DividerState;
65
+
66
+ export { }
@@ -0,0 +1 @@
1
+ export * from './components/Divider/index';
package/lib/Divider.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from './components/Divider/index';
2
+ //# sourceMappingURL=Divider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Divider.js","sourceRoot":"../src/","sources":["Divider.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC","sourcesContent":["export * from './components/Divider/index';\n"]}
@@ -0,0 +1,6 @@
1
+ import type { ForwardRefComponent } from '@fluentui/react-utilities';
2
+ import type { DividerProps } from './Divider.types';
3
+ /**
4
+ * A divider visually segments content into groups.
5
+ */
6
+ export declare const Divider: ForwardRefComponent<DividerProps>;
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ import { renderDivider_unstable } from './renderDivider';
3
+ import { useDivider_unstable } from './useDivider';
4
+ import { useDividerStyles_unstable } from './useDividerStyles';
5
+ /**
6
+ * A divider visually segments content into groups.
7
+ */
8
+
9
+ export const Divider = /*#__PURE__*/React.forwardRef((props, ref) => {
10
+ const state = useDivider_unstable(props, ref);
11
+ useDividerStyles_unstable(state);
12
+ return renderDivider_unstable(state);
13
+ });
14
+ Divider.displayName = 'Divider';
15
+ //# sourceMappingURL=Divider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,sBAAT,QAAuC,iBAAvC;AACA,SAAS,mBAAT,QAAoC,cAApC;AACA,SAAS,yBAAT,QAA0C,oBAA1C;AAIA;;AAEG;;AACH,OAAO,MAAM,OAAO,gBAAsC,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACxF,QAAM,KAAK,GAAG,mBAAmB,CAAC,KAAD,EAAQ,GAAR,CAAjC;AAEA,EAAA,yBAAyB,CAAC,KAAD,CAAzB;AAEA,SAAO,sBAAsB,CAAC,KAAD,CAA7B;AACD,CANyD,CAAnD;AAQP,OAAO,CAAC,WAAR,GAAsB,SAAtB","sourcesContent":["import * as React from 'react';\nimport { renderDivider_unstable } from './renderDivider';\nimport { useDivider_unstable } from './useDivider';\nimport { useDividerStyles_unstable } from './useDividerStyles';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport type { DividerProps } from './Divider.types';\n\n/**\n * A divider visually segments content into groups.\n */\nexport const Divider: ForwardRefComponent<DividerProps> = React.forwardRef((props, ref) => {\n const state = useDivider_unstable(props, ref);\n\n useDividerStyles_unstable(state);\n\n return renderDivider_unstable(state);\n});\n\nDivider.displayName = 'Divider';\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,36 @@
1
+ import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
2
+ export declare type DividerSlots = {
3
+ /**
4
+ * Root of the component that renders as a `<div>` tag.
5
+ */
6
+ root: Slot<'div'>;
7
+ /**
8
+ * Accessibility wrapper for content when presented.
9
+ */
10
+ wrapper: Slot<'div'>;
11
+ };
12
+ declare type DividerCommons = {
13
+ /**
14
+ * Determines the alignment of the content within the divider.
15
+ * @defaultvalue 'center'
16
+ */
17
+ alignContent: 'start' | 'center' | 'end';
18
+ /**
19
+ * A divider can have one of the preset appearances.
20
+ * When not specified, the divider has its default appearance.
21
+ */
22
+ appearance?: 'brand' | 'strong' | 'subtle';
23
+ /**
24
+ * Adds padding to the beginning and end of the divider.
25
+ * @default false
26
+ */
27
+ inset: boolean;
28
+ /**
29
+ * A divider can be horizontal (default) or vertical.
30
+ * @default false
31
+ */
32
+ vertical: boolean;
33
+ };
34
+ export declare type DividerProps = ComponentProps<Partial<DividerSlots>> & Partial<DividerCommons>;
35
+ export declare type DividerState = ComponentState<DividerSlots> & DividerCommons;
36
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=Divider.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Divider.types.js","sourceRoot":"../src/","sources":["components/Divider/Divider.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type DividerSlots = {\n /**\n * Root of the component that renders as a `<div>` tag.\n */\n root: Slot<'div'>;\n\n /**\n * Accessibility wrapper for content when presented.\n */\n wrapper: Slot<'div'>;\n};\n\ntype DividerCommons = {\n /**\n * Determines the alignment of the content within the divider.\n * @defaultvalue 'center'\n */\n alignContent: 'start' | 'center' | 'end';\n\n /**\n * A divider can have one of the preset appearances.\n * When not specified, the divider has its default appearance.\n */\n appearance?: 'brand' | 'strong' | 'subtle';\n\n /**\n * Adds padding to the beginning and end of the divider.\n * @default false\n */\n inset: boolean;\n\n /**\n * A divider can be horizontal (default) or vertical.\n * @default false\n */\n vertical: boolean;\n};\n\nexport type DividerProps = ComponentProps<Partial<DividerSlots>> & Partial<DividerCommons>;\n\nexport type DividerState = ComponentState<DividerSlots> & DividerCommons;\n"]}
@@ -0,0 +1,5 @@
1
+ export * from './Divider';
2
+ export * from './Divider.types';
3
+ export * from './renderDivider';
4
+ export * from './useDivider';
5
+ export * from './useDividerStyles';
@@ -0,0 +1,6 @@
1
+ export * from './Divider';
2
+ export * from './Divider.types';
3
+ export * from './renderDivider';
4
+ export * from './useDivider';
5
+ export * from './useDividerStyles';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Divider/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC","sourcesContent":["export * from './Divider';\nexport * from './Divider.types';\nexport * from './renderDivider';\nexport * from './useDivider';\nexport * from './useDividerStyles';\n"]}
@@ -0,0 +1,5 @@
1
+ import { DividerState } from './Divider.types';
2
+ /**
3
+ * Renders a Divider component by passing the slot props (defined in `state`) to the appropriate slots.
4
+ */
5
+ export declare const renderDivider_unstable: (state: DividerState) => JSX.Element;
@@ -0,0 +1,16 @@
1
+ import * as React from 'react';
2
+ import { getSlots } from '@fluentui/react-utilities';
3
+ /**
4
+ * Renders a Divider component by passing the slot props (defined in `state`) to the appropriate slots.
5
+ */
6
+
7
+ export const renderDivider_unstable = state => {
8
+ const {
9
+ slots,
10
+ slotProps
11
+ } = getSlots(state);
12
+ return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
13
+ }, slotProps.root.children !== undefined && /*#__PURE__*/React.createElement(slots.wrapper, { ...slotProps.wrapper
14
+ }, slotProps.root.children));
15
+ };
16
+ //# sourceMappingURL=renderDivider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Divider/renderDivider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,sBAAsB,GAAI,KAAD,IAAwB;AAC5D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAe,KAAf,CAArC;AACA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,SAAS,CAAC,IAAV,CAAe,QAAf,KAA4B,SAA5B,iBACC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;AAAf,GAAd,EAAuC,SAAS,CAAC,IAAV,CAAe,QAAtD,CAFJ,CADF;AAOD,CATM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { DividerSlots, DividerState } from './Divider.types';\n\n/**\n * Renders a Divider component by passing the slot props (defined in `state`) to the appropriate slots.\n */\nexport const renderDivider_unstable = (state: DividerState) => {\n const { slots, slotProps } = getSlots<DividerSlots>(state);\n return (\n <slots.root {...slotProps.root}>\n {slotProps.root.children !== undefined && (\n <slots.wrapper {...slotProps.wrapper}>{slotProps.root.children}</slots.wrapper>\n )}\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,8 @@
1
+ import * as React from 'react';
2
+ import type { DividerProps, DividerState } from './Divider.types';
3
+ /**
4
+ * Returns the props and state required to render the component
5
+ * @param props - User-provided props to the Divider component.
6
+ * @param ref - User-provided ref to be passed to the Divider component.
7
+ */
8
+ export declare const useDivider_unstable: (props: DividerProps, ref: React.Ref<HTMLElement>) => DividerState;
@@ -0,0 +1,43 @@
1
+ import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';
2
+ /**
3
+ * Returns the props and state required to render the component
4
+ * @param props - User-provided props to the Divider component.
5
+ * @param ref - User-provided ref to be passed to the Divider component.
6
+ */
7
+
8
+ export const useDivider_unstable = (props, ref) => {
9
+ const {
10
+ alignContent = 'center',
11
+ appearance,
12
+ inset = false,
13
+ vertical = false,
14
+ wrapper
15
+ } = props;
16
+ const dividerId = useId('divider-');
17
+ return {
18
+ // Props passed at the top-level
19
+ alignContent,
20
+ appearance,
21
+ inset,
22
+ vertical,
23
+ // Slots definition
24
+ components: {
25
+ root: 'div',
26
+ wrapper: 'div'
27
+ },
28
+ root: getNativeElementProps('div', { ...props,
29
+ ref,
30
+ role: 'separator',
31
+ 'aria-orientation': vertical ? 'vertical' : 'horizontal',
32
+ 'aria-labelledby': props.children ? dividerId : undefined
33
+ }),
34
+ wrapper: resolveShorthand(wrapper, {
35
+ required: true,
36
+ defaultProps: {
37
+ id: dividerId,
38
+ children: props.children
39
+ }
40
+ })
41
+ };
42
+ };
43
+ //# sourceMappingURL=useDivider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["components/Divider/useDivider.ts"],"names":[],"mappings":"AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,KAAlD,QAA+D,2BAA/D;AAGA;;;;AAIG;;AACH,OAAO,MAAM,mBAAmB,GAAG,CAAC,KAAD,EAAsB,GAAtB,KAAmE;AACpG,QAAM;AAAE,IAAA,YAAY,GAAG,QAAjB;AAA2B,IAAA,UAA3B;AAAuC,IAAA,KAAK,GAAG,KAA/C;AAAsD,IAAA,QAAQ,GAAG,KAAjE;AAAwE,IAAA;AAAxE,MAAoF,KAA1F;AACA,QAAM,SAAS,GAAG,KAAK,CAAC,UAAD,CAAvB;AAEA,SAAO;AACL;AACA,IAAA,YAFK;AAGL,IAAA,UAHK;AAIL,IAAA,KAJK;AAKL,IAAA,QALK;AAOL;AACA,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,OAAO,EAAE;AAFC,KARP;AAaL,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAQ,EACjC,GAAG,KAD8B;AAEjC,MAAA,GAFiC;AAGjC,MAAA,IAAI,EAAE,WAH2B;AAIjC,0BAAoB,QAAQ,GAAG,UAAH,GAAgB,YAJX;AAKjC,yBAAmB,KAAK,CAAC,QAAN,GAAiB,SAAjB,GAA6B;AALf,KAAR,CAbtB;AAoBL,IAAA,OAAO,EAAE,gBAAgB,CAAC,OAAD,EAAU;AACjC,MAAA,QAAQ,EAAE,IADuB;AAEjC,MAAA,YAAY,EAAE;AACZ,QAAA,EAAE,EAAE,SADQ;AAEZ,QAAA,QAAQ,EAAE,KAAK,CAAC;AAFJ;AAFmB,KAAV;AApBpB,GAAP;AA4BD,CAhCM","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';\nimport type { DividerProps, DividerState } from './Divider.types';\n\n/**\n * Returns the props and state required to render the component\n * @param props - User-provided props to the Divider component.\n * @param ref - User-provided ref to be passed to the Divider component.\n */\nexport const useDivider_unstable = (props: DividerProps, ref: React.Ref<HTMLElement>): DividerState => {\n const { alignContent = 'center', appearance, inset = false, vertical = false, wrapper } = props;\n const dividerId = useId('divider-');\n\n return {\n // Props passed at the top-level\n alignContent,\n appearance,\n inset,\n vertical,\n\n // Slots definition\n components: {\n root: 'div',\n wrapper: 'div',\n },\n\n root: getNativeElementProps('div', {\n ...props,\n ref,\n role: 'separator',\n 'aria-orientation': vertical ? 'vertical' : 'horizontal',\n 'aria-labelledby': props.children ? dividerId : undefined,\n }),\n wrapper: resolveShorthand(wrapper, {\n required: true,\n defaultProps: {\n id: dividerId,\n children: props.children,\n },\n }),\n };\n};\n"],"sourceRoot":"../src/"}
@@ -0,0 +1,3 @@
1
+ import { DividerState } from './Divider.types';
2
+ export declare const dividerClassName = "fui-Divider";
3
+ export declare const useDividerStyles_unstable: (state: DividerState) => DividerState;
@@ -0,0 +1,179 @@
1
+ import { mergeClasses, shorthands, __styles } from '@griffel/react';
2
+ import { tokens } from '@fluentui/react-theme';
3
+ export const dividerClassName = 'fui-Divider';
4
+ const contentSpacing = '12px';
5
+ const insetSpacing = '12px';
6
+ const maxStartEndLength = '8px';
7
+ const minStartEndLength = '8px;';
8
+
9
+ const useBaseStyles = /*#__PURE__*/__styles({
10
+ "base": {
11
+ "Bt984gj": "f122n59",
12
+ "B7ck84d": "f1ewtqcl",
13
+ "mc9l5x": "f22iagw",
14
+ "Beiy3e4": "f1063pyq",
15
+ "Bh6795r": "fqerorx",
16
+ "qhf8xq": "f10pi13n",
17
+ "Bahqtrf": "fk6fouc",
18
+ "Be2twd7": "fy9rknc",
19
+ "Bhrd7zp": "figsok6",
20
+ "Bg96gwp": "fwrc4pm",
21
+ "fsow6f": "f17mccla",
22
+ "sj55zd": "fkfq4zb",
23
+ "Bmqnesq": "f170vdtw",
24
+ "pmf9yy": "fkmkm9e",
25
+ "B438e65": "fbxxcv3",
26
+ "ijj6k": "f1vdjgj",
27
+ "I89eb": ["fz0g6r7", "f1h60vep"],
28
+ "Bp1vogq": "fn9f2qq",
29
+ "Bohd3ja": ["f1h60vep", "fz0g6r7"],
30
+ "oqd9ik": "ffdc0f3",
31
+ "Fdvyjd": "fsnc50s",
32
+ "keybh5": "fjrry2l",
33
+ "F7kzw7": "fii7hsz",
34
+ "B13j16c": ["fp9yzmz", "f1n0fcl2"],
35
+ "Bk8j60v": "f13jg1wd",
36
+ "Bpbi4o9": ["f1n0fcl2", "fp9yzmz"]
37
+ },
38
+ "childless": {
39
+ "z1nrnc": "fc3uzr1",
40
+ "vrnxjr": ["fhlqc5k", "flnsm0g"],
41
+ "Bsz71t5": ["f1957mjw", "fxrad5j"],
42
+ "Brd3o3m": "f1hmx8el"
43
+ },
44
+ "start": {
45
+ "Bs6t6z0": "fqc6z8f"
46
+ },
47
+ "center": {
48
+ "rurcny": "fuzzvh5",
49
+ "Bs6t6z0": "fqc6z8f"
50
+ },
51
+ "end": {
52
+ "rurcny": "fuzzvh5"
53
+ },
54
+ "brand": {
55
+ "sj55zd": "f16muhyy",
56
+ "ijj6k": "fob59v2",
57
+ "I89eb": ["f2pevzt", "fuyeql9"],
58
+ "Bp1vogq": "f14lh9hz",
59
+ "Bohd3ja": ["fuyeql9", "f2pevzt"],
60
+ "F7kzw7": "fd73d1p",
61
+ "B13j16c": ["f11ucet6", "f1yegzx5"],
62
+ "Bk8j60v": "f1tupb0d",
63
+ "Bpbi4o9": ["f1yegzx5", "f11ucet6"]
64
+ },
65
+ "subtle": {
66
+ "ijj6k": "f8mhi1x",
67
+ "I89eb": ["f18m2ouc", "fddukvx"],
68
+ "Bp1vogq": "f9zmk3m",
69
+ "Bohd3ja": ["fddukvx", "f18m2ouc"],
70
+ "F7kzw7": "fxli1ey",
71
+ "B13j16c": ["f1qvt1bb", "f5ob950"],
72
+ "Bk8j60v": "f1nn0kgk",
73
+ "Bpbi4o9": ["f5ob950", "f1qvt1bb"]
74
+ },
75
+ "strong": {
76
+ "ijj6k": "fkxqtrn",
77
+ "I89eb": ["f1yx8xct", "f2jll41"],
78
+ "Bp1vogq": "f1k9rjtw",
79
+ "Bohd3ja": ["f2jll41", "f1yx8xct"],
80
+ "F7kzw7": "f1i58boq",
81
+ "B13j16c": ["f4wmtn9", "f10n3jjp"],
82
+ "Bk8j60v": "ft17it6",
83
+ "Bpbi4o9": ["f10n3jjp", "f4wmtn9"]
84
+ }
85
+ }, {
86
+ "d": [".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".f1ewtqcl{box-sizing:border-box;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f1063pyq{-webkit-flex-direction:row;-ms-flex-direction:row;flex-direction:row;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f10pi13n{position:relative;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f17mccla{text-align:center;}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".f170vdtw:before{box-sizing:border-box;}", ".fkmkm9e:before{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fbxxcv3:before{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1vdjgj:before{border-top-color:var(--colorNeutralStroke2);}", ".fz0g6r7:before{border-right-color:var(--colorNeutralStroke2);}", ".f1h60vep:before{border-left-color:var(--colorNeutralStroke2);}", ".fn9f2qq:before{border-bottom-color:var(--colorNeutralStroke2);}", ".ffdc0f3:after{box-sizing:border-box;}", ".fsnc50s:after{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".fjrry2l:after{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".fii7hsz:after{border-top-color:var(--colorNeutralStroke2);}", ".fp9yzmz:after{border-right-color:var(--colorNeutralStroke2);}", ".f1n0fcl2:after{border-left-color:var(--colorNeutralStroke2);}", ".f13jg1wd:after{border-bottom-color:var(--colorNeutralStroke2);}", ".fc3uzr1:before{margin-bottom:0;}", ".fhlqc5k:before{margin-right:0;}", ".flnsm0g:before{margin-left:0;}", ".f1957mjw:after{margin-left:0;}", ".fxrad5j:after{margin-right:0;}", ".f1hmx8el:after{margin-top:0;}", ".fqc6z8f:after{content:\"\";}", ".fuzzvh5:before{content:\"\";}", ".f16muhyy{color:var(--colorBrandForeground1);}", ".fob59v2:before{border-top-color:var(--colorBrandStroke1);}", ".f2pevzt:before{border-right-color:var(--colorBrandStroke1);}", ".fuyeql9:before{border-left-color:var(--colorBrandStroke1);}", ".f14lh9hz:before{border-bottom-color:var(--colorBrandStroke1);}", ".fd73d1p:after{border-top-color:var(--colorBrandStroke1);}", ".f11ucet6:after{border-right-color:var(--colorBrandStroke1);}", ".f1yegzx5:after{border-left-color:var(--colorBrandStroke1);}", ".f1tupb0d:after{border-bottom-color:var(--colorBrandStroke1);}", ".f8mhi1x:before{border-top-color:var(--colorNeutralStroke3);}", ".f18m2ouc:before{border-right-color:var(--colorNeutralStroke3);}", ".fddukvx:before{border-left-color:var(--colorNeutralStroke3);}", ".f9zmk3m:before{border-bottom-color:var(--colorNeutralStroke3);}", ".fxli1ey:after{border-top-color:var(--colorNeutralStroke3);}", ".f1qvt1bb:after{border-right-color:var(--colorNeutralStroke3);}", ".f5ob950:after{border-left-color:var(--colorNeutralStroke3);}", ".f1nn0kgk:after{border-bottom-color:var(--colorNeutralStroke3);}", ".fkxqtrn:before{border-top-color:var(--colorNeutralStroke1);}", ".f1yx8xct:before{border-right-color:var(--colorNeutralStroke1);}", ".f2jll41:before{border-left-color:var(--colorNeutralStroke1);}", ".f1k9rjtw:before{border-bottom-color:var(--colorNeutralStroke1);}", ".f1i58boq:after{border-top-color:var(--colorNeutralStroke1);}", ".f4wmtn9:after{border-right-color:var(--colorNeutralStroke1);}", ".f10n3jjp:after{border-left-color:var(--colorNeutralStroke1);}", ".ft17it6:after{border-bottom-color:var(--colorNeutralStroke1);}"]
87
+ });
88
+
89
+ const useHorizontalStyles = /*#__PURE__*/__styles({
90
+ "base": {
91
+ "a9b677": "fly5x3f",
92
+ "Bdixowu": "f1bwkb58",
93
+ "dj0dih": "fn88edj",
94
+ "Bxms0xd": "f1lo4gz5",
95
+ "rskduk": "f1iq3fds",
96
+ "Bouo9z4": "f1oiuz89",
97
+ "Bcqngy1": "f108ofon"
98
+ },
99
+ "inset": {
100
+ "uwmqm3": ["fjlbh76", "f11qrl6u"],
101
+ "z189sj": ["f11qrl6u", "fjlbh76"]
102
+ },
103
+ "start": {
104
+ "rurcny": "fuzzvh5",
105
+ "vrnxjr": ["fncq426", "f12b5w6c"],
106
+ "B24asle": "f19fn84r",
107
+ "Bsz71t5": ["f1io6r2y", "fn6j208"]
108
+ },
109
+ "center": {
110
+ "vrnxjr": ["fncq426", "f12b5w6c"],
111
+ "Bsz71t5": ["f1io6r2y", "fn6j208"]
112
+ },
113
+ "end": {
114
+ "vrnxjr": ["fncq426", "f12b5w6c"],
115
+ "Bs6t6z0": "fqc6z8f",
116
+ "Bsz71t5": ["f1io6r2y", "fn6j208"],
117
+ "B79fe3b": "f3tzpys"
118
+ }
119
+ }, {
120
+ "d": [".fly5x3f{width:100%;}", ".f1bwkb58:before{border-top-style:solid;}", ".fn88edj:before{border-top-width:var(--strokeWidthThin);}", ".f1lo4gz5:before{min-width:8px;}", ".f1iq3fds:after{border-top-style:solid;}", ".f1oiuz89:after{border-top-width:var(--strokeWidthThin);}", ".f108ofon:after{min-width:8px;}", ".fjlbh76{padding-left:12px;}", ".f11qrl6u{padding-right:12px;}", ".fuzzvh5:before{content:\"\";}", ".fncq426:before{margin-right:12px;}", ".f12b5w6c:before{margin-left:12px;}", ".f19fn84r:before{max-width:8px;}", ".f1io6r2y:after{margin-left:12px;}", ".fn6j208:after{margin-right:12px;}", ".fqc6z8f:after{content:\"\";}", ".f3tzpys:after{max-width:8px;}"]
121
+ });
122
+
123
+ const useVerticalStyles = /*#__PURE__*/__styles({
124
+ "base": {
125
+ "Beiy3e4": "f1vx9l62",
126
+ "sshi5w": "f16gbxbe",
127
+ "cqycoz": ["fiio4mc", "fc8z0qo"],
128
+ "D4ky5z": ["f54lnp5", "f5hao24"],
129
+ "Bxq2otu": "f11zhyjz",
130
+ "Dctjco": ["f1r2jemi", "f11olovk"],
131
+ "Bjz4wo8": ["f1o2ol1z", "f20720x"],
132
+ "B5p8dqe": "f14bbtgr"
133
+ },
134
+ "inset": {
135
+ "B6of3ja": "f1xdg43u",
136
+ "jrapky": "f1jlhsmd"
137
+ },
138
+ "withChildren": {
139
+ "sshi5w": "f1tjaq3g"
140
+ },
141
+ "start": {
142
+ "rurcny": "fuzzvh5",
143
+ "z1nrnc": "f1xy8239",
144
+ "B5kj21": "f1hheky8",
145
+ "Brd3o3m": "f1mz1b17"
146
+ },
147
+ "center": {
148
+ "z1nrnc": "f1xy8239",
149
+ "Brd3o3m": "f1mz1b17"
150
+ },
151
+ "end": {
152
+ "z1nrnc": "f1xy8239",
153
+ "Bs6t6z0": "fqc6z8f",
154
+ "Brd3o3m": "f1mz1b17",
155
+ "iiodbw": "fp342oa"
156
+ }
157
+ }, {
158
+ "d": [".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f16gbxbe{min-height:20px;}", ".fiio4mc:before{border-right-style:solid;}", ".fc8z0qo:before{border-left-style:solid;}", ".f54lnp5:before{border-right-width:var(--strokeWidthThin);}", ".f5hao24:before{border-left-width:var(--strokeWidthThin);}", ".f11zhyjz:before{min-height:8px;}", ".f1r2jemi:after{border-right-style:solid;}", ".f11olovk:after{border-left-style:solid;}", ".f1o2ol1z:after{border-right-width:var(--strokeWidthThin);}", ".f20720x:after{border-left-width:var(--strokeWidthThin);}", ".f14bbtgr:after{min-height:8px;}", ".f1xdg43u{margin-top:12px;}", ".f1jlhsmd{margin-bottom:12px;}", ".f1tjaq3g{min-height:84px;}", ".fuzzvh5:before{content:\"\";}", ".f1xy8239:before{margin-bottom:12px;}", ".f1hheky8:before{max-height:8px;}", ".f1mz1b17:after{margin-top:12px;}", ".fqc6z8f:after{content:\"\";}", ".fp342oa:after{max-height:8px;}"]
159
+ });
160
+
161
+ export const useDividerStyles_unstable = state => {
162
+ const baseStyles = useBaseStyles();
163
+ const horizontalStyles = useHorizontalStyles();
164
+ const verticalStyles = useVerticalStyles();
165
+ const {
166
+ alignContent,
167
+ appearance,
168
+ inset,
169
+ vertical
170
+ } = state;
171
+ state.root.className = mergeClasses(dividerClassName, // Base styles
172
+ baseStyles.base, baseStyles[alignContent], appearance && baseStyles[appearance], // Horizontal styles
173
+ !vertical && horizontalStyles.base, !vertical && inset && horizontalStyles.inset, !vertical && horizontalStyles[alignContent], // Vertical styles
174
+ vertical && verticalStyles.base, vertical && inset && verticalStyles.inset, vertical && verticalStyles[alignContent], vertical && state.root.children !== undefined && verticalStyles.withChildren, // Childless styles
175
+ state.root.children === undefined && baseStyles.childless, // User provided class name
176
+ state.root.className);
177
+ return state;
178
+ };
179
+ //# sourceMappingURL=useDividerStyles.js.map