@fluentui/react-select 0.0.0-nightly-20220525-0423.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.
- package/CHANGELOG.json +194 -0
- package/CHANGELOG.md +96 -0
- package/LICENSE +15 -0
- package/README.md +9 -0
- package/Spec.md +243 -0
- package/dist/index.d.ts +68 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/lib/Select.js +2 -0
- package/lib/Select.js.map +1 -0
- package/lib/components/Select/Select.js +15 -0
- package/lib/components/Select/Select.js.map +1 -0
- package/lib/components/Select/Select.types.js +2 -0
- package/lib/components/Select/Select.types.js.map +1 -0
- package/lib/components/Select/index.js +6 -0
- package/lib/components/Select/index.js.map +1 -0
- package/lib/components/Select/renderSelect.js +17 -0
- package/lib/components/Select/renderSelect.js.map +1 -0
- package/lib/components/Select/useSelect.js +56 -0
- package/lib/components/Select/useSelect.js.map +1 -0
- package/lib/components/Select/useSelectStyles.js +219 -0
- package/lib/components/Select/useSelectStyles.js.map +1 -0
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -0
- package/lib-commonjs/Select.js +10 -0
- package/lib-commonjs/Select.js.map +1 -0
- package/lib-commonjs/components/Select/Select.js +26 -0
- package/lib-commonjs/components/Select/Select.js.map +1 -0
- package/lib-commonjs/components/Select/Select.types.js +6 -0
- package/lib-commonjs/components/Select/Select.types.js.map +1 -0
- package/lib-commonjs/components/Select/index.js +18 -0
- package/lib-commonjs/components/Select/index.js.map +1 -0
- package/lib-commonjs/components/Select/renderSelect.js +28 -0
- package/lib-commonjs/components/Select/renderSelect.js.map +1 -0
- package/lib-commonjs/components/Select/useSelect.js +68 -0
- package/lib-commonjs/components/Select/useSelect.js.map +1 -0
- package/lib-commonjs/components/Select/useSelectStyles.js +230 -0
- package/lib-commonjs/components/Select/useSelectStyles.js.map +1 -0
- package/lib-commonjs/index.js +40 -0
- package/lib-commonjs/index.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.types.js","sourceRoot":"../src/","sources":["components/Select/Select.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type SelectSlots = {\n /*\n * Wrapper for both the select and icon, renders as a `<span>`.\n * The `className` and `style` props on `<Select>` are applied to this slot;\n * All other top-level props are applied to the primary slot, `select`.\n */\n root: NonNullable<Slot<'span'>>;\n\n /** Primary slot: the actual `<select>` element */\n select: NonNullable<Slot<'select'>>;\n\n /** the icon, typically a down arrow */\n icon: Slot<'span'>;\n};\n\nexport type SelectProps = Omit<ComponentProps<Partial<SelectSlots>, 'select'>, 'size'> & {\n /**\n * Controls the colors and borders of the Select.\n *\n * @default 'outline'\n */\n appearance?: 'outline' | 'underline' | 'filled-darker' | 'filled-lighter';\n\n /**\n * If true, the Select will have an inline `display`, allowing it to be inline with other content.\n * By default, Select has block layout.\n *\n * @default false\n */\n inline?: boolean;\n\n /**\n * Matches the Input sizes\n *\n * @default 'medium'\n */\n size?: 'small' | 'medium' | 'large';\n};\n\nexport type SelectState = ComponentState<SelectSlots> & Required<Pick<SelectProps, 'appearance' | 'inline' | 'size'>>;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["components/Select/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './Select';\nexport * from './Select.types';\nexport * from './renderSelect';\nexport * from './useSelect';\nexport * from './useSelectStyles';\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getSlots } from '@fluentui/react-utilities';
|
|
3
|
+
/**
|
|
4
|
+
* Render the final JSX of Select
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const renderSelect_unstable = state => {
|
|
8
|
+
const {
|
|
9
|
+
slots,
|
|
10
|
+
slotProps
|
|
11
|
+
} = getSlots(state);
|
|
12
|
+
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
13
|
+
}, /*#__PURE__*/React.createElement(slots.select, { ...slotProps.select
|
|
14
|
+
}, slotProps.select.children), /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
|
15
|
+
}));
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=renderSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Select/renderSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAGA;;AAEG;;AACH,OAAO,MAAM,qBAAqB,GAAI,KAAD,IAAuB;AAC1D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAc,KAAd,CAArC;AACA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,eACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;AAAf,GAAb,EAAqC,SAAS,CAAC,MAAV,CAAiB,QAAtD,CADF,eAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFF,CADF;AAMD,CARM","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SelectSlots, SelectState } from './Select.types';\n\n/**\n * Render the final JSX of Select\n */\nexport const renderSelect_unstable = (state: SelectState) => {\n const { slots, slotProps } = getSlots<SelectSlots>(state);\n return (\n <slots.root {...slotProps.root}>\n <slots.select {...slotProps.select}>{slotProps.select.children}</slots.select>\n <slots.icon {...slotProps.icon} />\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { getPartitionedNativeProps, resolveShorthand } from '@fluentui/react-utilities';
|
|
3
|
+
import { ChevronDownRegular } from '@fluentui/react-icons';
|
|
4
|
+
/**
|
|
5
|
+
* Create the state required to render Select.
|
|
6
|
+
*
|
|
7
|
+
* The returned state can be modified with hooks such as useSelectStyles,
|
|
8
|
+
* before being passed to renderSelect.
|
|
9
|
+
*
|
|
10
|
+
* @param props - props from this instance of Select
|
|
11
|
+
* @param ref - reference to the `<select>` element in Select
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export const useSelect_unstable = (props, ref) => {
|
|
15
|
+
const {
|
|
16
|
+
select,
|
|
17
|
+
icon,
|
|
18
|
+
root,
|
|
19
|
+
size = 'medium',
|
|
20
|
+
appearance = 'outline',
|
|
21
|
+
inline = false
|
|
22
|
+
} = props;
|
|
23
|
+
const nativeProps = getPartitionedNativeProps({
|
|
24
|
+
props,
|
|
25
|
+
primarySlotTagName: 'select',
|
|
26
|
+
excludedPropNames: ['appearance', 'inline', 'size']
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
size,
|
|
30
|
+
appearance,
|
|
31
|
+
inline,
|
|
32
|
+
components: {
|
|
33
|
+
root: 'span',
|
|
34
|
+
select: 'select',
|
|
35
|
+
icon: 'span'
|
|
36
|
+
},
|
|
37
|
+
select: resolveShorthand(select, {
|
|
38
|
+
required: true,
|
|
39
|
+
defaultProps: {
|
|
40
|
+
ref,
|
|
41
|
+
...nativeProps.primary
|
|
42
|
+
}
|
|
43
|
+
}),
|
|
44
|
+
icon: resolveShorthand(icon, {
|
|
45
|
+
required: true,
|
|
46
|
+
defaultProps: {
|
|
47
|
+
children: /*#__PURE__*/React.createElement(ChevronDownRegular, null)
|
|
48
|
+
}
|
|
49
|
+
}),
|
|
50
|
+
root: resolveShorthand(root, {
|
|
51
|
+
required: true,
|
|
52
|
+
defaultProps: nativeProps.root
|
|
53
|
+
})
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=useSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Select/useSelect.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,yBAAT,EAAoC,gBAApC,QAA4D,2BAA5D;AACA,SAAS,kBAAT,QAAmC,uBAAnC;AAGA;;;;;;;;AAQG;;AACH,OAAO,MAAM,kBAAkB,GAAG,CAAC,KAAD,EAAqB,GAArB,KAAuE;AACvG,QAAM;AAAE,IAAA,MAAF;AAAU,IAAA,IAAV;AAAgB,IAAA,IAAhB;AAAsB,IAAA,IAAI,GAAG,QAA7B;AAAuC,IAAA,UAAU,GAAG,SAApD;AAA+D,IAAA,MAAM,GAAG;AAAxE,MAAkF,KAAxF;AAEA,QAAM,WAAW,GAAG,yBAAyB,CAAC;AAC5C,IAAA,KAD4C;AAE5C,IAAA,kBAAkB,EAAE,QAFwB;AAG5C,IAAA,iBAAiB,EAAE,CAAC,YAAD,EAAe,QAAf,EAAyB,MAAzB;AAHyB,GAAD,CAA7C;AAMA,SAAO;AACL,IAAA,IADK;AAEL,IAAA,UAFK;AAGL,IAAA,MAHK;AAIL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,MADI;AAEV,MAAA,MAAM,EAAE,QAFE;AAGV,MAAA,IAAI,EAAE;AAHI,KAJP;AASL,IAAA,MAAM,EAAE,gBAAgB,CAAC,MAAD,EAAS;AAC/B,MAAA,QAAQ,EAAE,IADqB;AAE/B,MAAA,YAAY,EAAE;AACZ,QAAA,GADY;AAEZ,WAAG,WAAW,CAAC;AAFH;AAFiB,KAAT,CATnB;AAgBL,IAAA,IAAI,EAAE,gBAAgB,CAAC,IAAD,EAAO;AAC3B,MAAA,QAAQ,EAAE,IADiB;AAE3B,MAAA,YAAY,EAAE;AAAE,QAAA,QAAQ,eAAE,KAAA,CAAA,aAAA,CAAC,kBAAD,EAAmB,IAAnB;AAAZ;AAFa,KAAP,CAhBjB;AAoBL,IAAA,IAAI,EAAE,gBAAgB,CAAC,IAAD,EAAO;AAC3B,MAAA,QAAQ,EAAE,IADiB;AAE3B,MAAA,YAAY,EAAE,WAAW,CAAC;AAFC,KAAP;AApBjB,GAAP;AAyBD,CAlCM","sourcesContent":["import * as React from 'react';\nimport { getPartitionedNativeProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { ChevronDownRegular } from '@fluentui/react-icons';\nimport type { SelectProps, SelectState } from './Select.types';\n\n/**\n * Create the state required to render Select.\n *\n * The returned state can be modified with hooks such as useSelectStyles,\n * before being passed to renderSelect.\n *\n * @param props - props from this instance of Select\n * @param ref - reference to the `<select>` element in Select\n */\nexport const useSelect_unstable = (props: SelectProps, ref: React.Ref<HTMLSelectElement>): SelectState => {\n const { select, icon, root, size = 'medium', appearance = 'outline', inline = false } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'select',\n excludedPropNames: ['appearance', 'inline', 'size'],\n });\n\n return {\n size,\n appearance,\n inline,\n components: {\n root: 'span',\n select: 'select',\n icon: 'span',\n },\n select: resolveShorthand(select, {\n required: true,\n defaultProps: {\n ref,\n ...nativeProps.primary,\n },\n }),\n icon: resolveShorthand(icon, {\n required: true,\n defaultProps: { children: <ChevronDownRegular /> },\n }),\n root: resolveShorthand(root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { __styles, mergeClasses, shorthands } from '@griffel/react';
|
|
2
|
+
import { tokens, typographyStyles } from '@fluentui/react-theme';
|
|
3
|
+
export const selectClassNames = {
|
|
4
|
+
root: 'fui-Select',
|
|
5
|
+
select: 'fui-Select__select',
|
|
6
|
+
icon: 'fui-Select__icon'
|
|
7
|
+
};
|
|
8
|
+
const iconSizes = {
|
|
9
|
+
small: '16px',
|
|
10
|
+
medium: '20px',
|
|
11
|
+
large: '24px'
|
|
12
|
+
}; // TODO: This 400 style is not in the typography styles.
|
|
13
|
+
// May need a design change
|
|
14
|
+
|
|
15
|
+
const contentSizes = {
|
|
16
|
+
400: {
|
|
17
|
+
fontSize: tokens.fontSizeBase400,
|
|
18
|
+
lineHeight: tokens.lineHeightBase400
|
|
19
|
+
}
|
|
20
|
+
}; //TODO: Should fieldHeights be a set of global design tokens or constants?
|
|
21
|
+
|
|
22
|
+
const fieldHeights = {
|
|
23
|
+
small: '24px',
|
|
24
|
+
medium: '32px',
|
|
25
|
+
large: '40px'
|
|
26
|
+
};
|
|
27
|
+
/* end of shared values */
|
|
28
|
+
|
|
29
|
+
const useRootStyles = /*#__PURE__*/__styles({
|
|
30
|
+
"base": {
|
|
31
|
+
"Bt984gj": "f122n59",
|
|
32
|
+
"B7ck84d": "f1ewtqcl",
|
|
33
|
+
"mc9l5x": "f22iagw",
|
|
34
|
+
"Eh141a": "flvyvdh",
|
|
35
|
+
"Bahqtrf": "fk6fouc",
|
|
36
|
+
"qhf8xq": "f10pi13n",
|
|
37
|
+
"Bb096xy": "fw24s6l",
|
|
38
|
+
"frdscb": ["fvxed1z", "f1j2a01o"],
|
|
39
|
+
"B9nohqn": ["f1j2a01o", "fvxed1z"],
|
|
40
|
+
"B1dhsta": ["f1pvm60u", "f179ivkp"],
|
|
41
|
+
"Bjdmjzx": ["f179ivkp", "f1pvm60u"],
|
|
42
|
+
"oqd9ik": "ffdc0f3",
|
|
43
|
+
"Bs6t6z0": "fqc6z8f",
|
|
44
|
+
"mpb1vu": "feciixf",
|
|
45
|
+
"Hdbjpj": "f11ef69",
|
|
46
|
+
"Bj55yzk": "fw2wsqs",
|
|
47
|
+
"jc51t6": ["f1cvlmu2", "f15lyva8"],
|
|
48
|
+
"cnmfks": ["f15lyva8", "f1cvlmu2"],
|
|
49
|
+
"xn0juu": "f1lmmjng",
|
|
50
|
+
"wbfbqe": "fopw4to",
|
|
51
|
+
"mafdb0": "f1jogkkn",
|
|
52
|
+
"s1xtto": "f1hql58f",
|
|
53
|
+
"umuwi5": "fjw5xc1",
|
|
54
|
+
"Blcqepd": "f1xdyd5c",
|
|
55
|
+
"nplu4u": "fatpbeo",
|
|
56
|
+
"Bioka5o": "fb7uyps"
|
|
57
|
+
}
|
|
58
|
+
}, {
|
|
59
|
+
"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;}", ".flvyvdh{-webkit-box-flex-wrap:nowrap;-webkit-flex-wrap:nowrap;-ms-flex-wrap:nowrap;flex-wrap:nowrap;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".f10pi13n{position:relative;}", ".fw24s6l:after{background-image:linear-gradient(\n 0deg,\n var(--colorCompoundBrandStroke) 0%,\n var(--colorCompoundBrandStroke) 50%,\n transparent 50%,\n transparent 100%\n );}", ".fvxed1z:after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f1j2a01o:after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1pvm60u:after{border-top-right-radius:0;}", ".f179ivkp:after{border-top-left-radius:0;}", ".ffdc0f3:after{box-sizing:border-box;}", ".fqc6z8f:after{content:\"\";}", ".feciixf:after{height:var(--borderRadiusMedium);}", ".f11ef69:after{position:absolute;}", ".fw2wsqs:after{bottom:0;}", ".f1cvlmu2:after{left:0;}", ".f15lyva8:after{right:0;}", ".f1lmmjng:after{-webkit-transform:scaleX(0);-moz-transform:scaleX(0);-ms-transform:scaleX(0);transform:scaleX(0);}", ".fopw4to:after{transition-property:transform;}", ".f1jogkkn:after{transition-duration:var(--durationUltraFast);}", ".f1hql58f:after{transition-delay:var(--curveAccelerateMid);}"],
|
|
60
|
+
"w": [".fjw5xc1:focus-within::after{-webkit-transform:scaleX(1);-moz-transform:scaleX(1);-ms-transform:scaleX(1);transform:scaleX(1);}", ".f1xdyd5c:focus-within::after{transition-property:transform;}", ".fatpbeo:focus-within::after{transition-duration:var(--durationNormal);}", ".fb7uyps:focus-within::after{transition-delay:var(--curveDecelerateMid);}"]
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const useSelectStyles = /*#__PURE__*/__styles({
|
|
64
|
+
"base": {
|
|
65
|
+
"Bowrso0": "fqrijq1",
|
|
66
|
+
"B4j52fo": "f5ogflp",
|
|
67
|
+
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
|
68
|
+
"Bn0qgzm": "f1f09k3d",
|
|
69
|
+
"ibv6hh": ["finvdd3", "f1hqa2wf"],
|
|
70
|
+
"icvyot": "fzkkow9",
|
|
71
|
+
"vrafjx": ["fcdblym", "fjik90z"],
|
|
72
|
+
"oivjwe": "fg706s2",
|
|
73
|
+
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
74
|
+
"g2u3we": "f1p3nwhy",
|
|
75
|
+
"h3c5rm": ["f11589ue", "f1pdflbu"],
|
|
76
|
+
"B9xav0g": "f1q5o8ev",
|
|
77
|
+
"zhjwy3": ["f1pdflbu", "f11589ue"],
|
|
78
|
+
"Bbmb7ep": ["f1aa9q02", "f16jpd5f"],
|
|
79
|
+
"Beyfa6y": ["f16jpd5f", "f1aa9q02"],
|
|
80
|
+
"B7oj6ja": ["f1jar5jt", "fyu767a"],
|
|
81
|
+
"Btl43ni": ["fyu767a", "f1jar5jt"],
|
|
82
|
+
"E5pizo": "f1couhl3",
|
|
83
|
+
"B7ck84d": "f1ewtqcl",
|
|
84
|
+
"sj55zd": "f19n0e5",
|
|
85
|
+
"Bh6795r": "fqerorx",
|
|
86
|
+
"Beohmeb": "f11uhznr",
|
|
87
|
+
"B486eqv": "f1u8i3ug",
|
|
88
|
+
"vu0emg": "fe1nke"
|
|
89
|
+
},
|
|
90
|
+
"disabled": {
|
|
91
|
+
"De3pzq": "f1c21dwh",
|
|
92
|
+
"sj55zd": "f1s2aq7o",
|
|
93
|
+
"Bceei9c": "fdrzuqr"
|
|
94
|
+
},
|
|
95
|
+
"small": {
|
|
96
|
+
"Bqenvij": "frvgh55",
|
|
97
|
+
"z8tnut": "f1g0x7ka",
|
|
98
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
99
|
+
"Byoj8tv": "f1qch9an",
|
|
100
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
101
|
+
"Bahqtrf": "fk6fouc",
|
|
102
|
+
"Be2twd7": "fy9rknc",
|
|
103
|
+
"Bhrd7zp": "figsok6",
|
|
104
|
+
"Bg96gwp": "fwrc4pm"
|
|
105
|
+
},
|
|
106
|
+
"medium": {
|
|
107
|
+
"Bqenvij": "f1d2rq10",
|
|
108
|
+
"z8tnut": "f1g0x7ka",
|
|
109
|
+
"z189sj": ["f11gcy0p", "f1ng84yb"],
|
|
110
|
+
"Byoj8tv": "f1qch9an",
|
|
111
|
+
"uwmqm3": ["f1ng84yb", "f11gcy0p"],
|
|
112
|
+
"Bahqtrf": "fk6fouc",
|
|
113
|
+
"Be2twd7": "fkhj508",
|
|
114
|
+
"Bhrd7zp": "figsok6",
|
|
115
|
+
"Bg96gwp": "f1i3iumi"
|
|
116
|
+
},
|
|
117
|
+
"large": {
|
|
118
|
+
"Bqenvij": "fbhnoac",
|
|
119
|
+
"z8tnut": "f1g0x7ka",
|
|
120
|
+
"z189sj": ["fw5db7e", "f1uw59to"],
|
|
121
|
+
"Byoj8tv": "f1qch9an",
|
|
122
|
+
"uwmqm3": ["f1uw59to", "fw5db7e"],
|
|
123
|
+
"Be2twd7": "fod5ikn",
|
|
124
|
+
"Bg96gwp": "faaz57k"
|
|
125
|
+
},
|
|
126
|
+
"outline": {
|
|
127
|
+
"De3pzq": "fxugw4r",
|
|
128
|
+
"B4j52fo": "f5ogflp",
|
|
129
|
+
"Bekrc4i": ["f1hqa2wf", "finvdd3"],
|
|
130
|
+
"Bn0qgzm": "f1f09k3d",
|
|
131
|
+
"ibv6hh": ["finvdd3", "f1hqa2wf"],
|
|
132
|
+
"icvyot": "fzkkow9",
|
|
133
|
+
"vrafjx": ["fcdblym", "fjik90z"],
|
|
134
|
+
"oivjwe": "fg706s2",
|
|
135
|
+
"wvpqe5": ["fjik90z", "fcdblym"],
|
|
136
|
+
"g2u3we": "fj3muxo",
|
|
137
|
+
"h3c5rm": ["f1akhkt", "f1lxtadh"],
|
|
138
|
+
"B9xav0g": "f1c1zstj",
|
|
139
|
+
"zhjwy3": ["f1lxtadh", "f1akhkt"]
|
|
140
|
+
},
|
|
141
|
+
"underline": {
|
|
142
|
+
"De3pzq": "f1c21dwh",
|
|
143
|
+
"Bn0qgzm": "f1f09k3d",
|
|
144
|
+
"oivjwe": "fg706s2",
|
|
145
|
+
"B9xav0g": "f1c1zstj",
|
|
146
|
+
"Bbmb7ep": ["f1krrbdw", "f1deotkl"],
|
|
147
|
+
"Beyfa6y": ["f1deotkl", "f1krrbdw"],
|
|
148
|
+
"B7oj6ja": ["f10ostut", "f1ozlkrg"],
|
|
149
|
+
"Btl43ni": ["f1ozlkrg", "f10ostut"]
|
|
150
|
+
},
|
|
151
|
+
"filled-lighter": {
|
|
152
|
+
"De3pzq": "fxugw4r"
|
|
153
|
+
},
|
|
154
|
+
"filled-darker": {
|
|
155
|
+
"De3pzq": "f16xq7d1"
|
|
156
|
+
}
|
|
157
|
+
}, {
|
|
158
|
+
"d": [".fqrijq1{-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;appearance:none;}", ".f5ogflp{border-top-width:1px;}", ".f1hqa2wf{border-right-width:1px;}", ".finvdd3{border-left-width:1px;}", ".f1f09k3d{border-bottom-width:1px;}", ".fzkkow9{border-top-style:solid;}", ".fcdblym{border-right-style:solid;}", ".fjik90z{border-left-style:solid;}", ".fg706s2{border-bottom-style:solid;}", ".f1p3nwhy{border-top-color:transparent;}", ".f11589ue{border-right-color:transparent;}", ".f1pdflbu{border-left-color:transparent;}", ".f1q5o8ev{border-bottom-color:transparent;}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f1couhl3{box-shadow:none;}", ".f1ewtqcl{box-sizing:border-box;}", ".f19n0e5{color:var(--colorNeutralForeground1);}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f1c21dwh{background-color:var(--colorTransparentBackground);}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}", ".fdrzuqr{cursor:not-allowed;}", ".frvgh55{height:24px;}", ".f1g0x7ka{padding-top:0;}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".f1qch9an{padding-bottom:0;}", ".fk6fouc{font-family:var(--fontFamilyBase);}", ".fy9rknc{font-size:var(--fontSizeBase200);}", ".figsok6{font-weight:var(--fontWeightRegular);}", ".fwrc4pm{line-height:var(--lineHeightBase200);}", ".f1d2rq10{height:32px;}", ".f11gcy0p{padding-right:var(--spacingHorizontalMNudge);}", ".f1ng84yb{padding-left:var(--spacingHorizontalMNudge);}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1i3iumi{line-height:var(--lineHeightBase300);}", ".fbhnoac{height:40px;}", ".fw5db7e{padding-right:var(--spacingHorizontalM);}", ".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".fod5ikn{font-size:var(--fontSizeBase400);}", ".faaz57k{line-height:var(--lineHeightBase400);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".fj3muxo{border-top-color:var(--colorNeutralStroke1);}", ".f1akhkt{border-right-color:var(--colorNeutralStroke1);}", ".f1lxtadh{border-left-color:var(--colorNeutralStroke1);}", ".f1c1zstj{border-bottom-color:var(--colorNeutralStrokeAccessible);}", ".f1krrbdw{border-bottom-right-radius:0;}", ".f1deotkl{border-bottom-left-radius:0;}", ".f10ostut{border-top-right-radius:0;}", ".f1ozlkrg{border-top-left-radius:0;}", ".f16xq7d1{background-color:var(--colorNeutralBackground3);}"],
|
|
159
|
+
"i": [".f11uhznr:focus-visible{outline-width:2px;}", ".f1u8i3ug:focus-visible{outline-style:solid;}", ".fe1nke:focus-visible{outline-color:transparent;}"]
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const useIconStyles = /*#__PURE__*/__styles({
|
|
163
|
+
"icon": {
|
|
164
|
+
"B7ck84d": "f1ewtqcl",
|
|
165
|
+
"sj55zd": "fxkbij4",
|
|
166
|
+
"mc9l5x": "ftgm304",
|
|
167
|
+
"qhf8xq": "f1euv43f",
|
|
168
|
+
"j35jbq": ["fnyteob", "f1enpzzf"],
|
|
169
|
+
"Bkecrkj": "f1aehjj5",
|
|
170
|
+
"Bo70h7d": "fvc9v3g"
|
|
171
|
+
},
|
|
172
|
+
"small": {
|
|
173
|
+
"Be2twd7": "f4ybsrx",
|
|
174
|
+
"Bqenvij": "fd461yt",
|
|
175
|
+
"z189sj": ["fdw0yi8", "fk8j09s"],
|
|
176
|
+
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
177
|
+
"a9b677": "fjw5fx7"
|
|
178
|
+
},
|
|
179
|
+
"medium": {
|
|
180
|
+
"Be2twd7": "fe5j1ua",
|
|
181
|
+
"Bqenvij": "fjamq6b",
|
|
182
|
+
"z189sj": ["fw5db7e", "f1uw59to"],
|
|
183
|
+
"uwmqm3": ["fgiv446", "ffczdla"],
|
|
184
|
+
"a9b677": "f64fuq3"
|
|
185
|
+
},
|
|
186
|
+
"large": {
|
|
187
|
+
"Be2twd7": "f1rt2boy",
|
|
188
|
+
"Bqenvij": "frvgh55",
|
|
189
|
+
"z189sj": ["fw5db7e", "f1uw59to"],
|
|
190
|
+
"uwmqm3": ["fk8j09s", "fdw0yi8"],
|
|
191
|
+
"a9b677": "fq4mcun"
|
|
192
|
+
}
|
|
193
|
+
}, {
|
|
194
|
+
"d": [".f1ewtqcl{box-sizing:border-box;}", ".fxkbij4{color:var(--colorNeutralStrokeAccessible);}", ".ftgm304{display:block;}", ".f1euv43f{position:absolute;}", ".fnyteob{right:var(--spacingHorizontalMNudge);}", ".f1enpzzf{left:var(--spacingHorizontalMNudge);}", ".f1aehjj5{pointer-events:none;}", ".fvc9v3g svg{display:block;}", ".f4ybsrx{font-size:16px;}", ".fd461yt{height:16px;}", ".fdw0yi8{padding-right:var(--spacingHorizontalSNudge);}", ".fk8j09s{padding-left:var(--spacingHorizontalSNudge);}", ".fgiv446{padding-left:var(--spacingHorizontalXXS);}", ".ffczdla{padding-right:var(--spacingHorizontalXXS);}", ".fjw5fx7{width:16px;}", ".fe5j1ua{font-size:20px;}", ".fjamq6b{height:20px;}", ".fw5db7e{padding-right:var(--spacingHorizontalM);}", ".f1uw59to{padding-left:var(--spacingHorizontalM);}", ".f64fuq3{width:20px;}", ".f1rt2boy{font-size:24px;}", ".frvgh55{height:24px;}", ".fq4mcun{width:24px;}"]
|
|
195
|
+
});
|
|
196
|
+
/**
|
|
197
|
+
* Apply styling to the Select slots based on the state
|
|
198
|
+
*/
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
export const useSelectStyles_unstable = state => {
|
|
202
|
+
const {
|
|
203
|
+
size,
|
|
204
|
+
appearance
|
|
205
|
+
} = state;
|
|
206
|
+
const disabled = state.select.disabled;
|
|
207
|
+
const iconStyles = useIconStyles();
|
|
208
|
+
const rootStyles = useRootStyles();
|
|
209
|
+
const selectStyles = useSelectStyles();
|
|
210
|
+
state.root.className = mergeClasses(selectClassNames.root, rootStyles.base, state.root.className);
|
|
211
|
+
state.select.className = mergeClasses(selectClassNames.select, selectStyles.base, selectStyles[size], selectStyles[appearance], disabled && selectStyles.disabled, state.select.className);
|
|
212
|
+
|
|
213
|
+
if (state.icon) {
|
|
214
|
+
state.icon.className = mergeClasses(selectClassNames.icon, iconStyles.icon, iconStyles[size], state.icon.className);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return state;
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=useSelectStyles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Select/useSelectStyles.ts"],"names":[],"mappings":"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","sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { SlotClassNames } from '@fluentui/react-utilities';\nimport type { SelectSlots, SelectState } from './Select.types';\n\nexport const selectClassNames: SlotClassNames<SelectSlots> = {\n root: 'fui-Select',\n select: 'fui-Select__select',\n icon: 'fui-Select__icon',\n};\n\nconst iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px',\n};\n\n// TODO: This 400 style is not in the typography styles.\n// May need a design change\nconst contentSizes = {\n 400: {\n fontSize: tokens.fontSizeBase400,\n lineHeight: tokens.lineHeightBase400,\n },\n};\n\n//TODO: Should fieldHeights be a set of global design tokens or constants?\nconst fieldHeights = {\n small: '24px',\n medium: '32px',\n large: '40px',\n};\n\n/* end of shared values */\n\nconst useRootStyles = makeStyles({\n base: {\n alignItems: 'center',\n boxSizing: 'border-box',\n display: 'flex',\n flexWrap: 'nowrap',\n fontFamily: tokens.fontFamilyBase,\n position: 'relative',\n\n '&:after': {\n backgroundImage: `linear-gradient(\n 0deg,\n ${tokens.colorCompoundBrandStroke} 0%,\n ${tokens.colorCompoundBrandStroke} 50%,\n transparent 50%,\n transparent 100%\n )`,\n ...shorthands.borderRadius(0, 0, tokens.borderRadiusMedium, tokens.borderRadiusMedium),\n boxSizing: 'border-box',\n content: '\"\"',\n height: tokens.borderRadiusMedium,\n position: 'absolute',\n bottom: '0',\n left: '0',\n right: '0',\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n },\n\n '&:focus-within::after': {\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n },\n },\n});\n\nconst useSelectStyles = makeStyles({\n base: {\n appearance: 'none',\n ...shorthands.border('1px', 'solid', 'transparent'),\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n boxShadow: 'none',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n flexGrow: 1,\n\n ':focus-visible': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n },\n disabled: {\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n },\n small: {\n height: fieldHeights.small,\n ...shorthands.padding('0', tokens.spacingHorizontalSNudge),\n ...typographyStyles.caption1,\n },\n medium: {\n height: fieldHeights.medium,\n ...shorthands.padding('0', tokens.spacingHorizontalMNudge),\n ...typographyStyles.body1,\n },\n large: {\n height: fieldHeights.large,\n ...shorthands.padding('0', tokens.spacingHorizontalM),\n ...contentSizes[400],\n },\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n ...shorthands.border('1px', 'solid', tokens.colorNeutralStroke1),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderBottom('1px', 'solid', tokens.colorNeutralStrokeAccessible),\n ...shorthands.borderRadius(0),\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n },\n});\n\nconst useIconStyles = makeStyles({\n icon: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralStrokeAccessible,\n display: 'block',\n position: 'absolute',\n right: tokens.spacingHorizontalMNudge,\n pointerEvents: 'none',\n\n // the SVG must have display: block for accurate positioning\n // otherwise an extra inline space is inserted after the svg element\n '& svg': {\n display: 'block',\n },\n },\n small: {\n fontSize: iconSizes.small,\n height: iconSizes.small,\n paddingRight: tokens.spacingHorizontalSNudge,\n paddingLeft: tokens.spacingHorizontalXXS,\n width: iconSizes.small,\n },\n medium: {\n fontSize: iconSizes.medium,\n height: iconSizes.medium,\n paddingRight: tokens.spacingHorizontalM,\n paddingLeft: tokens.spacingHorizontalXXS,\n width: iconSizes.medium,\n },\n large: {\n fontSize: iconSizes.large,\n height: iconSizes.large,\n paddingRight: tokens.spacingHorizontalM,\n paddingLeft: tokens.spacingHorizontalSNudge,\n width: iconSizes.large,\n },\n});\n\n/**\n * Apply styling to the Select slots based on the state\n */\nexport const useSelectStyles_unstable = (state: SelectState): SelectState => {\n const { size, appearance } = state;\n const disabled = state.select.disabled;\n\n const iconStyles = useIconStyles();\n const rootStyles = useRootStyles();\n const selectStyles = useSelectStyles();\n\n state.root.className = mergeClasses(selectClassNames.root, rootStyles.base, state.root.className);\n\n state.select.className = mergeClasses(\n selectClassNames.select,\n selectStyles.base,\n selectStyles[size],\n selectStyles[appearance],\n disabled && selectStyles.disabled,\n state.select.className,\n );\n\n if (state.icon) {\n state.icon.className = mergeClasses(selectClassNames.icon, iconStyles.icon, iconStyles[size], state.icon.className);\n }\n\n return state;\n};\n"],"sourceRoot":"../src/"}
|
package/lib/index.js
ADDED
package/lib/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["index.ts"],"names":[],"mappings":"AAAA,SACE,MADF,EAEE,gBAFF,EAGE,qBAHF,EAIE,wBAJF,EAKE,kBALF,QAMO,UANP","sourcesContent":["export {\n Select,\n selectClassNames,\n renderSelect_unstable,\n useSelectStyles_unstable,\n useSelect_unstable,\n} from './Select';\nexport type { SelectProps, SelectSlots, SelectState } from './Select';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["Select.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,2BAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './components/Select/index';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Select = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const useSelect_1 = /*#__PURE__*/require("./useSelect");
|
|
11
|
+
|
|
12
|
+
const renderSelect_1 = /*#__PURE__*/require("./renderSelect");
|
|
13
|
+
|
|
14
|
+
const useSelectStyles_1 = /*#__PURE__*/require("./useSelectStyles");
|
|
15
|
+
/**
|
|
16
|
+
* Select component
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
exports.Select = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
21
|
+
const state = useSelect_1.useSelect_unstable(props, ref);
|
|
22
|
+
useSelectStyles_1.useSelectStyles_unstable(state);
|
|
23
|
+
return renderSelect_1.renderSelect_unstable(state);
|
|
24
|
+
});
|
|
25
|
+
exports.Select.displayName = 'Select';
|
|
26
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Select/Select.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,WAAA,gBAAA,OAAA,CAAA,aAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,mBAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,MAAA,gBAA2C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtF,QAAM,KAAK,GAAG,WAAA,CAAA,kBAAA,CAAmB,KAAnB,EAA0B,GAA1B,CAAd;AAEA,EAAA,iBAAA,CAAA,wBAAA,CAAyB,KAAzB;AACA,SAAO,cAAA,CAAA,qBAAA,CAAsB,KAAtB,CAAP;AACD,CALuD,CAA3C;AAOb,OAAA,CAAA,MAAA,CAAO,WAAP,GAAqB,QAArB","sourcesContent":["import * as React from 'react';\nimport { useSelect_unstable } from './useSelect';\nimport { renderSelect_unstable } from './renderSelect';\nimport { useSelectStyles_unstable } from './useSelectStyles';\nimport type { SelectProps } from './Select.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\n\n/**\n * Select component\n */\nexport const Select: ForwardRefComponent<SelectProps> = React.forwardRef((props, ref) => {\n const state = useSelect_unstable(props, ref);\n\n useSelectStyles_unstable(state);\n return renderSelect_unstable(state);\n});\n\nSelect.displayName = 'Select';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","sourceRoot":"../src/"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
|
8
|
+
|
|
9
|
+
tslib_1.__exportStar(require("./Select"), exports);
|
|
10
|
+
|
|
11
|
+
tslib_1.__exportStar(require("./Select.types"), exports);
|
|
12
|
+
|
|
13
|
+
tslib_1.__exportStar(require("./renderSelect"), exports);
|
|
14
|
+
|
|
15
|
+
tslib_1.__exportStar(require("./useSelect"), exports);
|
|
16
|
+
|
|
17
|
+
tslib_1.__exportStar(require("./useSelectStyles"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Select/index.ts"],"names":[],"mappings":";;;;;;;;AAAA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,UAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,gBAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,aAAA,CAAA,EAAA,OAAA;;AACA,OAAA,CAAA,YAAA,CAAA,OAAA,CAAA,mBAAA,CAAA,EAAA,OAAA","sourcesContent":["export * from './Select';\nexport * from './Select.types';\nexport * from './renderSelect';\nexport * from './useSelect';\nexport * from './useSelectStyles';\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.renderSelect_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
+
/**
|
|
12
|
+
* Render the final JSX of Select
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
const renderSelect_unstable = state => {
|
|
17
|
+
const {
|
|
18
|
+
slots,
|
|
19
|
+
slotProps
|
|
20
|
+
} = react_utilities_1.getSlots(state);
|
|
21
|
+
return React.createElement(slots.root, { ...slotProps.root
|
|
22
|
+
}, React.createElement(slots.select, { ...slotProps.select
|
|
23
|
+
}, slotProps.select.children), React.createElement(slots.icon, { ...slotProps.icon
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.renderSelect_unstable = renderSelect_unstable;
|
|
28
|
+
//# sourceMappingURL=renderSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Select/renderSelect.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,qBAAqB,GAAI,KAAD,IAAuB;AAC1D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAsB,KAAtB,CAA7B;AACA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,MAAP,EAAa,EAAA,GAAK,SAAS,CAAC;AAAf,GAAb,EAAqC,SAAS,CAAC,MAAV,CAAiB,QAAtD,CADF,EAEE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFF,CADF;AAMD,CARM;;AAAM,OAAA,CAAA,qBAAA,GAAqB,qBAArB","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { SelectSlots, SelectState } from './Select.types';\n\n/**\n * Render the final JSX of Select\n */\nexport const renderSelect_unstable = (state: SelectState) => {\n const { slots, slotProps } = getSlots<SelectSlots>(state);\n return (\n <slots.root {...slotProps.root}>\n <slots.select {...slotProps.select}>{slotProps.select.children}</slots.select>\n <slots.icon {...slotProps.icon} />\n </slots.root>\n );\n};\n"],"sourceRoot":"../src/"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useSelect_unstable = void 0;
|
|
7
|
+
|
|
8
|
+
const React = /*#__PURE__*/require("react");
|
|
9
|
+
|
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
11
|
+
|
|
12
|
+
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
|
13
|
+
/**
|
|
14
|
+
* Create the state required to render Select.
|
|
15
|
+
*
|
|
16
|
+
* The returned state can be modified with hooks such as useSelectStyles,
|
|
17
|
+
* before being passed to renderSelect.
|
|
18
|
+
*
|
|
19
|
+
* @param props - props from this instance of Select
|
|
20
|
+
* @param ref - reference to the `<select>` element in Select
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
const useSelect_unstable = (props, ref) => {
|
|
25
|
+
const {
|
|
26
|
+
select,
|
|
27
|
+
icon,
|
|
28
|
+
root,
|
|
29
|
+
size = 'medium',
|
|
30
|
+
appearance = 'outline',
|
|
31
|
+
inline = false
|
|
32
|
+
} = props;
|
|
33
|
+
const nativeProps = react_utilities_1.getPartitionedNativeProps({
|
|
34
|
+
props,
|
|
35
|
+
primarySlotTagName: 'select',
|
|
36
|
+
excludedPropNames: ['appearance', 'inline', 'size']
|
|
37
|
+
});
|
|
38
|
+
return {
|
|
39
|
+
size,
|
|
40
|
+
appearance,
|
|
41
|
+
inline,
|
|
42
|
+
components: {
|
|
43
|
+
root: 'span',
|
|
44
|
+
select: 'select',
|
|
45
|
+
icon: 'span'
|
|
46
|
+
},
|
|
47
|
+
select: react_utilities_1.resolveShorthand(select, {
|
|
48
|
+
required: true,
|
|
49
|
+
defaultProps: {
|
|
50
|
+
ref,
|
|
51
|
+
...nativeProps.primary
|
|
52
|
+
}
|
|
53
|
+
}),
|
|
54
|
+
icon: react_utilities_1.resolveShorthand(icon, {
|
|
55
|
+
required: true,
|
|
56
|
+
defaultProps: {
|
|
57
|
+
children: React.createElement(react_icons_1.ChevronDownRegular, null)
|
|
58
|
+
}
|
|
59
|
+
}),
|
|
60
|
+
root: react_utilities_1.resolveShorthand(root, {
|
|
61
|
+
required: true,
|
|
62
|
+
defaultProps: nativeProps.root
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
exports.useSelect_unstable = useSelect_unstable;
|
|
68
|
+
//# sourceMappingURL=useSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["components/Select/useSelect.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AACA,MAAA,aAAA,gBAAA,OAAA,CAAA,uBAAA,CAAA;AAGA;;;;;;;;AAQG;;;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAD,EAAqB,GAArB,KAAuE;AACvG,QAAM;AAAE,IAAA,MAAF;AAAU,IAAA,IAAV;AAAgB,IAAA,IAAhB;AAAsB,IAAA,IAAI,GAAG,QAA7B;AAAuC,IAAA,UAAU,GAAG,SAApD;AAA+D,IAAA,MAAM,GAAG;AAAxE,MAAkF,KAAxF;AAEA,QAAM,WAAW,GAAG,iBAAA,CAAA,yBAAA,CAA0B;AAC5C,IAAA,KAD4C;AAE5C,IAAA,kBAAkB,EAAE,QAFwB;AAG5C,IAAA,iBAAiB,EAAE,CAAC,YAAD,EAAe,QAAf,EAAyB,MAAzB;AAHyB,GAA1B,CAApB;AAMA,SAAO;AACL,IAAA,IADK;AAEL,IAAA,UAFK;AAGL,IAAA,MAHK;AAIL,IAAA,UAAU,EAAE;AACV,MAAA,IAAI,EAAE,MADI;AAEV,MAAA,MAAM,EAAE,QAFE;AAGV,MAAA,IAAI,EAAE;AAHI,KAJP;AASL,IAAA,MAAM,EAAE,iBAAA,CAAA,gBAAA,CAAiB,MAAjB,EAAyB;AAC/B,MAAA,QAAQ,EAAE,IADqB;AAE/B,MAAA,YAAY,EAAE;AACZ,QAAA,GADY;AAEZ,WAAG,WAAW,CAAC;AAFH;AAFiB,KAAzB,CATH;AAgBL,IAAA,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,IAAjB,EAAuB;AAC3B,MAAA,QAAQ,EAAE,IADiB;AAE3B,MAAA,YAAY,EAAE;AAAE,QAAA,QAAQ,EAAE,KAAA,CAAA,aAAA,CAAC,aAAA,CAAA,kBAAD,EAAmB,IAAnB;AAAZ;AAFa,KAAvB,CAhBD;AAoBL,IAAA,IAAI,EAAE,iBAAA,CAAA,gBAAA,CAAiB,IAAjB,EAAuB;AAC3B,MAAA,QAAQ,EAAE,IADiB;AAE3B,MAAA,YAAY,EAAE,WAAW,CAAC;AAFC,KAAvB;AApBD,GAAP;AAyBD,CAlCM;;AAAM,OAAA,CAAA,kBAAA,GAAkB,kBAAlB","sourcesContent":["import * as React from 'react';\nimport { getPartitionedNativeProps, resolveShorthand } from '@fluentui/react-utilities';\nimport { ChevronDownRegular } from '@fluentui/react-icons';\nimport type { SelectProps, SelectState } from './Select.types';\n\n/**\n * Create the state required to render Select.\n *\n * The returned state can be modified with hooks such as useSelectStyles,\n * before being passed to renderSelect.\n *\n * @param props - props from this instance of Select\n * @param ref - reference to the `<select>` element in Select\n */\nexport const useSelect_unstable = (props: SelectProps, ref: React.Ref<HTMLSelectElement>): SelectState => {\n const { select, icon, root, size = 'medium', appearance = 'outline', inline = false } = props;\n\n const nativeProps = getPartitionedNativeProps({\n props,\n primarySlotTagName: 'select',\n excludedPropNames: ['appearance', 'inline', 'size'],\n });\n\n return {\n size,\n appearance,\n inline,\n components: {\n root: 'span',\n select: 'select',\n icon: 'span',\n },\n select: resolveShorthand(select, {\n required: true,\n defaultProps: {\n ref,\n ...nativeProps.primary,\n },\n }),\n icon: resolveShorthand(icon, {\n required: true,\n defaultProps: { children: <ChevronDownRegular /> },\n }),\n root: resolveShorthand(root, {\n required: true,\n defaultProps: nativeProps.root,\n }),\n };\n};\n"],"sourceRoot":"../src/"}
|