@fluentui/react-divider 9.0.0-alpha.9 → 9.0.0-nightly.46b9ea7036.0
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.
- package/CHANGELOG.json +1888 -1
- package/CHANGELOG.md +738 -2
- package/Spec.md +48 -53
- package/dist/react-divider.d.ts +28 -43
- package/lib/Divider.js.map +1 -1
- package/lib/common/isConformant.d.ts +3 -1
- package/lib/common/isConformant.js +7 -5
- package/lib/common/isConformant.js.map +1 -1
- package/lib/components/Divider/Divider.d.ts +3 -4
- package/lib/components/Divider/Divider.js +5 -5
- package/lib/components/Divider/Divider.js.map +1 -1
- package/lib/components/Divider/Divider.types.d.ts +25 -38
- package/lib/components/Divider/Divider.types.js +1 -0
- package/lib/components/Divider/Divider.types.js.map +1 -1
- package/lib/components/Divider/index.js +1 -0
- package/lib/components/Divider/index.js.map +1 -1
- package/lib/components/Divider/renderDivider.js +6 -4
- package/lib/components/Divider/renderDivider.js.map +1 -1
- package/lib/components/Divider/useDivider.d.ts +2 -7
- package/lib/components/Divider/useDivider.js +35 -17
- package/lib/components/Divider/useDivider.js.map +1 -1
- package/lib/components/Divider/useDividerStyles.d.ts +1 -1
- package/lib/components/Divider/useDividerStyles.js +143 -203
- package/lib/components/Divider/useDividerStyles.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/tsdoc-metadata.json +1 -1
- package/lib-commonjs/Divider.js +7 -2
- package/lib-commonjs/Divider.js.map +1 -1
- package/lib-commonjs/common/isConformant.d.ts +3 -1
- package/lib-commonjs/common/isConformant.js +17 -7
- package/lib-commonjs/common/isConformant.js.map +1 -1
- package/lib-commonjs/components/Divider/Divider.d.ts +3 -4
- package/lib-commonjs/components/Divider/Divider.js +19 -10
- package/lib-commonjs/components/Divider/Divider.js.map +1 -1
- package/lib-commonjs/components/Divider/Divider.types.d.ts +25 -38
- package/lib-commonjs/components/Divider/Divider.types.js +4 -1
- package/lib-commonjs/components/Divider/Divider.types.js.map +1 -1
- package/lib-commonjs/components/Divider/index.js +12 -2
- package/lib-commonjs/components/Divider/index.js.map +1 -1
- package/lib-commonjs/components/Divider/renderDivider.js +21 -9
- package/lib-commonjs/components/Divider/renderDivider.js.map +1 -1
- package/lib-commonjs/components/Divider/useDivider.d.ts +2 -7
- package/lib-commonjs/components/Divider/useDivider.js +45 -18
- package/lib-commonjs/components/Divider/useDivider.js.map +1 -1
- package/lib-commonjs/components/Divider/useDividerStyles.d.ts +1 -1
- package/lib-commonjs/components/Divider/useDividerStyles.js +151 -204
- package/lib-commonjs/components/Divider/useDividerStyles.js.map +1 -1
- package/lib-commonjs/index.js +7 -2
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +16 -12
- package/NOTICE.txt +0 -0
- package/config/api-extractor.json +0 -3
- package/config/tests.js +0 -7
- package/etc/react-divider.api.md +0 -45
- package/just.config.ts +0 -3
- package/lib-amd/Divider.d.ts +0 -1
- package/lib-amd/Divider.js +0 -6
- package/lib-amd/Divider.js.map +0 -1
- package/lib-amd/common/isConformant.d.ts +0 -2
- package/lib-amd/common/isConformant.js +0 -13
- package/lib-amd/common/isConformant.js.map +0 -1
- package/lib-amd/components/Divider/Divider.d.ts +0 -7
- package/lib-amd/components/Divider/Divider.js +0 -15
- package/lib-amd/components/Divider/Divider.js.map +0 -1
- package/lib-amd/components/Divider/Divider.types.d.ts +0 -48
- package/lib-amd/components/Divider/Divider.types.js +0 -5
- package/lib-amd/components/Divider/Divider.types.js.map +0 -1
- package/lib-amd/components/Divider/index.d.ts +0 -5
- package/lib-amd/components/Divider/index.js +0 -9
- package/lib-amd/components/Divider/index.js.map +0 -1
- package/lib-amd/components/Divider/renderDivider.d.ts +0 -5
- package/lib-amd/components/Divider/renderDivider.js +0 -13
- package/lib-amd/components/Divider/renderDivider.js.map +0 -1
- package/lib-amd/components/Divider/useDivider.d.ts +0 -13
- package/lib-amd/components/Divider/useDivider.js +0 -26
- package/lib-amd/components/Divider/useDivider.js.map +0 -1
- package/lib-amd/components/Divider/useDividerStyles.d.ts +0 -3
- package/lib-amd/components/Divider/useDividerStyles.js +0 -210
- package/lib-amd/components/Divider/useDividerStyles.js.map +0 -1
- package/lib-amd/index.d.ts +0 -1
- package/lib-amd/index.js +0 -6
- package/lib-amd/index.js.map +0 -1
- package/src/components/Divider/Divider.types.ts +0 -56
package/Spec.md
CHANGED
@@ -70,12 +70,6 @@ Icon
|
|
70
70
|
<Divider><Icon /></Divider>
|
71
71
|
```
|
72
72
|
|
73
|
-
Important
|
74
|
-
|
75
|
-
```html
|
76
|
-
<Divider important>This is important!</Divider>
|
77
|
-
```
|
78
|
-
|
79
73
|
Inset
|
80
74
|
|
81
75
|
```html
|
@@ -101,53 +95,54 @@ From [Divider.types.tsx](https://github.com/microsoft/fluentui/blob/master/packa
|
|
101
95
|
### Props
|
102
96
|
|
103
97
|
```ts
|
104
|
-
export
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
98
|
+
export type DividerProps = ComponentProps &
|
99
|
+
React.HTMLAttributes<HTMLElement> & {
|
100
|
+
/**
|
101
|
+
* Determines the alignment of the content within the divider.
|
102
|
+
* @defaultvalue 'center'
|
103
|
+
*/
|
104
|
+
alignContent?: 'start' | 'end' | 'center';
|
105
|
+
|
106
|
+
/**
|
107
|
+
* Predefined visual styles
|
108
|
+
* @defaultvalue 'default'
|
109
|
+
*/
|
110
|
+
appearance?: 'default' | 'subtle' | 'brand' | 'strong';
|
111
|
+
|
112
|
+
/**
|
113
|
+
* A divider can have a overriding border color
|
114
|
+
*/
|
115
|
+
color?: string;
|
116
|
+
|
117
|
+
/**
|
118
|
+
* A divider can be classified as important to emphasize its content
|
119
|
+
*/
|
120
|
+
important?: boolean;
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Adds a 12px padding to the begining and end of the divider
|
124
|
+
*/
|
125
|
+
inset?: boolean;
|
126
|
+
|
127
|
+
/**
|
128
|
+
* A divider can be horizontal (default) or vertical
|
129
|
+
*/
|
130
|
+
vertical?: boolean;
|
131
|
+
|
132
|
+
/**
|
133
|
+
* Overrides for border visuals
|
134
|
+
*/
|
135
|
+
borderStyle?: string;
|
136
|
+
borderSize?: string | number;
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Accessibility wrapper for content when presented.
|
140
|
+
* A shorthand prop can be a literal, object, or
|
141
|
+
* JSX. The `children` prop of the object can be a render function,
|
142
|
+
* taking in the original slot component and props.
|
143
|
+
*/
|
144
|
+
wrapper?: ShorthandProps<React.HTMLAttributes<HTMLDivElement>>;
|
145
|
+
};
|
151
146
|
```
|
152
147
|
|
153
148
|
## Styling Tokens
|
package/dist/react-divider.d.ts
CHANGED
@@ -1,65 +1,51 @@
|
|
1
|
-
import { ComponentProps } from '@fluentui/react-utilities';
|
2
|
-
import
|
3
|
-
import {
|
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 type { IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
5
|
+
import * as React_2 from 'react';
|
4
6
|
|
5
7
|
/**
|
6
8
|
* Define a styled Divider, using the `useDivider` and `useDividerStyles` hooks.
|
7
|
-
* {@docCategory Divider}
|
8
9
|
*/
|
9
|
-
export declare const Divider:
|
10
|
+
export declare const Divider: ForwardRefComponent<DividerProps>;
|
10
11
|
|
11
|
-
|
12
|
-
* {@docCategory Divider}
|
13
|
-
*/
|
14
|
-
export declare interface DividerProps extends ComponentProps, React.HTMLAttributes<HTMLElement> {
|
12
|
+
export declare type DividerCommons = {
|
15
13
|
/**
|
16
14
|
* Determines the alignment of the content within the divider.
|
17
15
|
* @defaultvalue 'center'
|
18
16
|
*/
|
19
|
-
alignContent
|
17
|
+
alignContent: 'start' | 'end' | 'center';
|
20
18
|
/**
|
21
|
-
*
|
22
|
-
*
|
19
|
+
* A divider can have one of the preset appearances.
|
20
|
+
* When not specified, the divider has its default appearance.
|
23
21
|
*/
|
24
|
-
appearance?: '
|
22
|
+
appearance?: 'brand' | 'strong' | 'subtle';
|
25
23
|
/**
|
26
|
-
*
|
24
|
+
* Adds padding to the beginning and end of the divider
|
25
|
+
* @default false
|
27
26
|
*/
|
28
|
-
|
27
|
+
inset: boolean;
|
29
28
|
/**
|
30
|
-
*
|
29
|
+
* A divider can be horizontal (default) or vertical
|
30
|
+
* @default false
|
31
31
|
*/
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
vertical: boolean;
|
33
|
+
};
|
34
|
+
|
35
|
+
export declare type DividerProps = ComponentProps<DividerSlots> & Partial<DividerCommons>;
|
36
|
+
|
37
|
+
export declare type DividerSlots = {
|
38
|
+
root: IntrinsicShorthandProps<'div'>;
|
36
39
|
/**
|
37
40
|
* Accessibility wrapper for content when presented.
|
38
41
|
* A shorthand prop can be a literal, object, or
|
39
42
|
* JSX. The `children` prop of the object can be a render function,
|
40
43
|
* taking in the original slot component and props.
|
41
44
|
*/
|
42
|
-
wrapper
|
43
|
-
}
|
44
|
-
|
45
|
-
/**
|
46
|
-
* Consts listing which props are shorthand props.
|
47
|
-
*/
|
48
|
-
export declare const dividerShorthandProps: readonly ["wrapper", "children"];
|
45
|
+
wrapper: IntrinsicShorthandProps<'div'>;
|
46
|
+
};
|
49
47
|
|
50
|
-
|
51
|
-
* {@docCategory Divider}
|
52
|
-
*/
|
53
|
-
export declare interface DividerState extends DividerProps {
|
54
|
-
/**
|
55
|
-
* Ref to the root slot
|
56
|
-
*/
|
57
|
-
ref: React.RefObject<HTMLElement>;
|
58
|
-
/**
|
59
|
-
* The Id created to expose accessability for readers
|
60
|
-
*/
|
61
|
-
labelledById?: string;
|
62
|
-
}
|
48
|
+
export declare type DividerState = ComponentState<DividerSlots> & DividerCommons;
|
63
49
|
|
64
50
|
/**
|
65
51
|
* Function that renders the final JSX of the component
|
@@ -70,11 +56,10 @@ export declare const renderDivider: (state: DividerState) => JSX.Element;
|
|
70
56
|
* Returns the props and state required to render the component
|
71
57
|
* @param props - Divider properties
|
72
58
|
* @param ref - reference to root HTMLElement of Divider
|
73
|
-
* @param defaultProps - default values for the properties of Divider
|
74
59
|
*/
|
75
|
-
export declare const useDivider: (props: DividerProps, ref:
|
60
|
+
export declare const useDivider: (props: DividerProps, ref: React_2.Ref<HTMLElement>) => DividerState;
|
76
61
|
|
77
62
|
/** Applies style classnames to slots */
|
78
|
-
export declare const useDividerStyles: (
|
63
|
+
export declare const useDividerStyles: (state: DividerState) => DividerState;
|
79
64
|
|
80
65
|
export { }
|
package/lib/Divider.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Divider.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"Divider.js","sourceRoot":"","sources":["../src/Divider.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC"}
|
@@ -1,2 +1,4 @@
|
|
1
1
|
import { IsConformantOptions } from '@fluentui/react-conformance';
|
2
|
-
export declare function isConformant(testInfo: Omit<IsConformantOptions
|
2
|
+
export declare function isConformant<TProps = {}>(testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & {
|
3
|
+
componentPath?: string;
|
4
|
+
}): void;
|
@@ -1,9 +1,11 @@
|
|
1
1
|
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
|
2
|
+
import makeStylesTests from '@fluentui/react-conformance-make-styles';
|
2
3
|
export function isConformant(testInfo) {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
var defaultOptions = {
|
5
|
+
asPropHandlesRef: true,
|
6
|
+
componentPath: module.parent.filename.replace('.test', ''),
|
7
|
+
extraTests: makeStylesTests
|
8
|
+
};
|
9
|
+
baseIsConformant(defaultOptions, testInfo);
|
8
10
|
}
|
9
11
|
//# sourceMappingURL=isConformant.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../src/common/isConformant.ts"],"names":[],"mappings":"AAAA,SAAS,YAAY,IAAI,gBAAzB,QAAkF,6BAAlF;AACA,OAAO,eAAP,MAA4B,yCAA5B;AAEA,OAAM,SAAU,YAAV,CACJ,QADI,EACqF;AAEzF,MAAM,cAAc,GAAyC;AAC3D,IAAA,gBAAgB,EAAE,IADyC;AAE3D,IAAA,aAAa,EAAE,MAAO,CAAC,MAAR,CAAgB,QAAhB,CAAyB,OAAzB,CAAiC,OAAjC,EAA0C,EAA1C,CAF4C;AAG3D,IAAA,UAAU,EAAE;AAH+C,GAA7D;AAMA,EAAA,gBAAgB,CAAC,cAAD,EAAiB,QAAjB,CAAhB;AACD","sourceRoot":""}
|
@@ -1,7 +1,6 @@
|
|
1
|
-
import
|
2
|
-
import {
|
1
|
+
import type { DividerProps } from './Divider.types';
|
2
|
+
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
3
3
|
/**
|
4
4
|
* Define a styled Divider, using the `useDivider` and `useDividerStyles` hooks.
|
5
|
-
* {@docCategory Divider}
|
6
5
|
*/
|
7
|
-
export declare const Divider:
|
6
|
+
export declare const Divider: ForwardRefComponent<DividerProps>;
|
@@ -4,12 +4,12 @@ import { useDivider } from './useDivider';
|
|
4
4
|
import { useDividerStyles } from './useDividerStyles';
|
5
5
|
/**
|
6
6
|
* Define a styled Divider, using the `useDivider` and `useDividerStyles` hooks.
|
7
|
-
* {@docCategory Divider}
|
8
7
|
*/
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
|
9
|
+
export var Divider = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
10
|
+
var state = useDivider(props, ref);
|
11
|
+
useDividerStyles(state);
|
12
|
+
return renderDivider(state);
|
13
13
|
});
|
14
14
|
Divider.displayName = 'Divider';
|
15
15
|
//# sourceMappingURL=Divider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,aAAT,QAA8B,iBAA9B;AACA,SAAS,UAAT,QAA2B,cAA3B;AACA,SAAS,gBAAT,QAAiC,oBAAjC;AAIA;;AAEG;;AACH,OAAO,IAAM,OAAO,gBAAsC,KAAK,CAAC,UAAN,CAAiB,UAAC,KAAD,EAAQ,GAAR,EAAW;AACpF,MAAM,KAAK,GAAG,UAAU,CAAC,KAAD,EAAQ,GAAR,CAAxB;AAEA,EAAA,gBAAgB,CAAC,KAAD,CAAhB;AACA,SAAO,aAAa,CAAC,KAAD,CAApB;AACD,CALyD,CAAnD;AAOP,OAAO,CAAC,WAAR,GAAsB,SAAtB","sourceRoot":""}
|
@@ -1,48 +1,35 @@
|
|
1
|
-
import
|
2
|
-
|
3
|
-
|
4
|
-
* {@docCategory Divider}
|
5
|
-
*/
|
6
|
-
export interface DividerProps extends ComponentProps, React.HTMLAttributes<HTMLElement> {
|
7
|
-
/**
|
8
|
-
* Determines the alignment of the content within the divider.
|
9
|
-
* @defaultvalue 'center'
|
10
|
-
*/
|
11
|
-
alignContent?: 'start' | 'end' | 'center';
|
12
|
-
/**
|
13
|
-
* Predefined visual styles
|
14
|
-
* @defaultvalue 'default'
|
15
|
-
*/
|
16
|
-
appearance?: 'default' | 'subtle' | 'brand' | 'strong';
|
17
|
-
/**
|
18
|
-
* A divider can be classified as important to emphasize its content
|
19
|
-
*/
|
20
|
-
important?: boolean;
|
21
|
-
/**
|
22
|
-
* Adds a 12px padding to the begining and end of the divider
|
23
|
-
*/
|
24
|
-
inset?: boolean;
|
25
|
-
/**
|
26
|
-
* A divider can be horizontal (default) or vertical*/
|
27
|
-
vertical?: boolean;
|
1
|
+
import type { ComponentProps, ComponentState, IntrinsicShorthandProps } from '@fluentui/react-utilities';
|
2
|
+
export declare type DividerSlots = {
|
3
|
+
root: IntrinsicShorthandProps<'div'>;
|
28
4
|
/**
|
29
5
|
* Accessibility wrapper for content when presented.
|
30
6
|
* A shorthand prop can be a literal, object, or
|
31
7
|
* JSX. The `children` prop of the object can be a render function,
|
32
8
|
* taking in the original slot component and props.
|
33
9
|
*/
|
34
|
-
wrapper
|
35
|
-
}
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
10
|
+
wrapper: IntrinsicShorthandProps<'div'>;
|
11
|
+
};
|
12
|
+
export declare type DividerCommons = {
|
13
|
+
/**
|
14
|
+
* Determines the alignment of the content within the divider.
|
15
|
+
* @defaultvalue 'center'
|
16
|
+
*/
|
17
|
+
alignContent: 'start' | 'end' | 'center';
|
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';
|
40
23
|
/**
|
41
|
-
*
|
24
|
+
* Adds padding to the beginning and end of the divider
|
25
|
+
* @default false
|
42
26
|
*/
|
43
|
-
|
27
|
+
inset: boolean;
|
44
28
|
/**
|
45
|
-
*
|
29
|
+
* A divider can be horizontal (default) or vertical
|
30
|
+
* @default false
|
46
31
|
*/
|
47
|
-
|
48
|
-
}
|
32
|
+
vertical: boolean;
|
33
|
+
};
|
34
|
+
export declare type DividerProps = ComponentProps<DividerSlots> & Partial<DividerCommons>;
|
35
|
+
export declare type DividerState = ComponentState<DividerSlots> & DividerCommons;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Divider.types.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"Divider.types.js","sourceRoot":"","sources":["../../../src/components/Divider/Divider.types.ts"],"names":[],"mappings":""}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/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"}
|
@@ -1,13 +1,15 @@
|
|
1
1
|
import { __assign } from "tslib";
|
2
2
|
import * as React from 'react';
|
3
3
|
import { getSlots } from '@fluentui/react-utilities';
|
4
|
-
import { dividerShorthandProps } from './useDivider';
|
5
4
|
/**
|
6
5
|
* Function that renders the final JSX of the component
|
7
6
|
*/
|
7
|
+
|
8
8
|
export var renderDivider = function (state) {
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
var _a = getSlots(state, ['root', 'wrapper']),
|
10
|
+
slots = _a.slots,
|
11
|
+
slotProps = _a.slotProps;
|
12
|
+
|
13
|
+
return /*#__PURE__*/React.createElement(slots.root, __assign({}, slotProps.root), slotProps.root.children !== undefined && /*#__PURE__*/React.createElement(slots.wrapper, __assign({}, slotProps.wrapper), slotProps.root.children));
|
12
14
|
};
|
13
15
|
//# sourceMappingURL=renderDivider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Divider/renderDivider.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,IAAM,aAAa,GAAG,UAAC,KAAD,EAAoB;AACzC,MAAA,EAAA,GAAuB,QAAQ,CAAe,KAAf,EAAsB,CAAC,MAAD,EAAS,SAAT,CAAtB,CAA/B;AAAA,MAAE,KAAK,GAAA,EAAA,CAAA,KAAP;AAAA,MAAS,SAAS,GAAA,EAAA,CAAA,SAAlB;;AACN,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,IAAf,CAAX,EACG,SAAS,CAAC,IAAV,CAAe,QAAf,KAA4B,SAA5B,iBACC,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,QAAA,CAAA,EAAA,EAAK,SAAS,CAAC,OAAf,CAAd,EAAuC,SAAS,CAAC,IAAV,CAAe,QAAtD,CAFJ,CADF;AAOD,CATM","sourceRoot":""}
|
@@ -1,13 +1,8 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import { DividerProps, DividerState } from './Divider.types';
|
3
|
-
/**
|
4
|
-
* Consts listing which props are shorthand props.
|
5
|
-
*/
|
6
|
-
export declare const dividerShorthandProps: readonly ["wrapper", "children"];
|
2
|
+
import type { DividerProps, DividerState } from './Divider.types';
|
7
3
|
/**
|
8
4
|
* Returns the props and state required to render the component
|
9
5
|
* @param props - Divider properties
|
10
6
|
* @param ref - reference to root HTMLElement of Divider
|
11
|
-
* @param defaultProps - default values for the properties of Divider
|
12
7
|
*/
|
13
|
-
export declare const useDivider: (props: DividerProps, ref: React.Ref<HTMLElement
|
8
|
+
export declare const useDivider: (props: DividerProps, ref: React.Ref<HTMLElement>) => DividerState;
|
@@ -1,24 +1,42 @@
|
|
1
|
-
import
|
2
|
-
import {
|
3
|
-
/**
|
4
|
-
* Consts listing which props are shorthand props.
|
5
|
-
*/
|
6
|
-
export var dividerShorthandProps = ['wrapper', 'children'];
|
7
|
-
var mergeProps = makeMergeProps({ deepMerge: dividerShorthandProps });
|
1
|
+
import { __assign } from "tslib";
|
2
|
+
import { getNativeElementProps, resolveShorthand, useId } from '@fluentui/react-utilities';
|
8
3
|
/**
|
9
4
|
* Returns the props and state required to render the component
|
10
5
|
* @param props - Divider properties
|
11
6
|
* @param ref - reference to root HTMLElement of Divider
|
12
|
-
* @param defaultProps - default values for the properties of Divider
|
13
7
|
*/
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
8
|
+
|
9
|
+
export var useDivider = function (props, ref) {
|
10
|
+
var _a = props.alignContent,
|
11
|
+
alignContent = _a === void 0 ? 'center' : _a,
|
12
|
+
_b = props.inset,
|
13
|
+
inset = _b === void 0 ? false : _b,
|
14
|
+
_c = props.vertical,
|
15
|
+
vertical = _c === void 0 ? false : _c,
|
16
|
+
appearance = props.appearance,
|
17
|
+
wrapper = props.wrapper;
|
18
|
+
var dividerId = useId('divider-');
|
19
|
+
return {
|
20
|
+
alignContent: alignContent,
|
21
|
+
inset: inset,
|
22
|
+
vertical: vertical,
|
23
|
+
appearance: appearance,
|
24
|
+
components: {
|
25
|
+
root: 'div',
|
26
|
+
wrapper: 'div'
|
27
|
+
},
|
28
|
+
root: getNativeElementProps('div', __assign(__assign({}, props), {
|
29
|
+
ref: ref,
|
30
|
+
role: 'separator',
|
31
|
+
'aria-labelledby': props.children ? dividerId : undefined
|
32
|
+
})),
|
33
|
+
wrapper: resolveShorthand(wrapper, {
|
34
|
+
required: true,
|
35
|
+
defaultProps: {
|
36
|
+
id: dividerId,
|
37
|
+
children: props.children
|
38
|
+
}
|
39
|
+
})
|
40
|
+
};
|
23
41
|
};
|
24
42
|
//# sourceMappingURL=useDivider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"sources":["../../../src/components/Divider/useDivider.ts"],"names":[],"mappings":";AACA,SAAS,qBAAT,EAAgC,gBAAhC,EAAkD,KAAlD,QAA+D,2BAA/D;AAGA;;;;AAIG;;AACH,OAAO,IAAM,UAAU,GAAG,UAAC,KAAD,EAAsB,GAAtB,EAAiD;AACjE,MAAA,EAAA,GAAkF,KAAK,CAAhE,YAAvB;AAAA,MAAA,YAAY,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,QAAH,GAAW,EAAvB;AAAA,MAAyB,EAAA,GAAyD,KAAK,CAAjD,KAAtC;AAAA,MAAyB,KAAK,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAtC;AAAA,MAAwC,EAAA,GAA0C,KAAK,CAA/B,QAAxD;AAAA,MAAwC,QAAQ,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,KAAH,GAAQ,EAAxD;AAAA,MAA0D,UAAU,GAAc,KAAK,CAAnB,UAApE;AAAA,MAAsE,OAAO,GAAK,KAAK,CAAV,OAA7E;AACR,MAAM,SAAS,GAAG,KAAK,CAAC,UAAD,CAAvB;AAEA,SAAO;AACL,IAAA,YAAY,EAAA,YADP;AAEL,IAAA,KAAK,EAAA,KAFA;AAGL,IAAA,QAAQ,EAAA,QAHH;AAIL,IAAA,UAAU,EAAA,UAJL;AAKL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,KADI;AAEV,MAAA,OAAO,EAAE;AAFC,KALP;AASL,IAAA,IAAI,EAAE,qBAAqB,CAAC,KAAD,EAAM,QAAA,CAAA,QAAA,CAAA,EAAA,EAC5B,KAD4B,CAAA,EACvB;AACR,MAAA,GAAG,EAAA,GADK;AAER,MAAA,IAAI,EAAE,WAFE;AAGR,yBAAmB,KAAK,CAAC,QAAN,GAAiB,SAAjB,GAA6B;AAHxC,KADuB,CAAN,CATtB;AAeL,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;AAfpB,GAAP;AAuBD,CA3BM","sourceRoot":""}
|