@fluentui/react-tag-picker 9.6.6 → 9.7.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.md +30 -2
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js +113 -0
- package/lib/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js.map +1 -0
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js +223 -0
- package/lib/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js.map +1 -0
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js +38 -0
- package/lib/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js.map +1 -0
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js +65 -0
- package/lib/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js.map +1 -0
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.raw.js +26 -0
- package/lib/components/TagPickerList/useTagPickerListStyles.styles.raw.js.map +1 -0
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js +51 -0
- package/lib/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js.map +1 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js +17 -0
- package/lib/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js +129 -0
- package/lib-commonjs/components/TagPickerButton/useTagPickerButtonStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js +245 -0
- package/lib-commonjs/components/TagPickerControl/useTagPickerControlStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js +54 -0
- package/lib-commonjs/components/TagPickerGroup/useTagPickerGroupStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js +81 -0
- package/lib-commonjs/components/TagPickerInput/useTagPickerInputStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.raw.js +42 -0
- package/lib-commonjs/components/TagPickerList/useTagPickerListStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js +67 -0
- package/lib-commonjs/components/TagPickerOption/useTagPickerOptionStyles.styles.raw.js.map +1 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js +33 -0
- package/lib-commonjs/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.raw.js.map +1 -0
- package/package.json +8 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOption/useTagPickerOptionStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerOptionSlots, TagPickerOptionState } from './TagPickerOption.types';\nimport { useOptionStyles_unstable } from '@fluentui/react-combobox';\nimport { typographyStyles } from '@fluentui/react-theme';\n\nexport const tagPickerOptionClassNames: SlotClassNames<TagPickerOptionSlots> = {\n root: 'fui-TagPickerOption',\n media: 'fui-TagPickerOption__media',\n secondaryContent: 'fui-TagPickerOption__secondaryContent',\n};\n\nconst useRootBaseStyle = makeResetStyles({\n display: 'flex',\n alignItems: 'center',\n});\n\nconst useRootStyles = makeStyles({\n secondaryContent: {\n display: 'grid',\n gridTemplateColumns: 'auto 1fr',\n },\n});\n\nconst useSecondaryContentBaseStyle = makeResetStyles({\n gridColumnStart: 2,\n gridRowStart: 2,\n ...typographyStyles.caption1,\n});\n\nconst useMediaBaseStyle = makeResetStyles({\n gridRowStart: 'span 2',\n});\n\n/**\n * Apply styling to the TagPickerOption slots based on the state\n */\nexport const useTagPickerOptionStyles_unstable = (state: TagPickerOptionState): TagPickerOptionState => {\n 'use no memo';\n\n const rootBaseStyle = useRootBaseStyle();\n const rootStyles = useRootStyles();\n const secondaryContentBaseStyle = useSecondaryContentBaseStyle();\n const mediaBaseStyle = useMediaBaseStyle();\n\n state.root.className = mergeClasses(\n tagPickerOptionClassNames.root,\n rootBaseStyle,\n state.secondaryContent && rootStyles.secondaryContent,\n state.root.className,\n );\n useOptionStyles_unstable({\n ...state,\n active: false,\n disabled: false,\n focusVisible: false,\n checkIcon: undefined,\n selected: false,\n });\n if (state.media) {\n state.media.className = mergeClasses(tagPickerOptionClassNames.media, mediaBaseStyle, state.media.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n tagPickerOptionClassNames.secondaryContent,\n secondaryContentBaseStyle,\n state.secondaryContent.className,\n );\n }\n\n return state;\n};\n"],"names":["makeResetStyles","makeStyles","mergeClasses","useOptionStyles_unstable","typographyStyles","tagPickerOptionClassNames","root","media","secondaryContent","useRootBaseStyle","display","alignItems","useRootStyles","gridTemplateColumns","useSecondaryContentBaseStyle","gridColumnStart","gridRowStart","caption1","useMediaBaseStyle","useTagPickerOptionStyles_unstable","state","rootBaseStyle","rootStyles","secondaryContentBaseStyle","mediaBaseStyle","className","active","disabled","focusVisible","checkIcon","undefined","selected"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,eAAe,EAAEC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG3E,SAASC,wBAAwB,QAAQ,2BAA2B;AACpE,SAASC,gBAAgB,QAAQ,wBAAwB;AAEzD,OAAO,MAAMC,4BAAkE;IAC7EC,MAAM;IACNC,OAAO;IACPC,kBAAkB;AACpB,EAAE;AAEF,MAAMC,mBAAmBT,gBAAgB;IACvCU,SAAS;IACTC,YAAY;AACd;AAEA,MAAMC,gBAAgBX,WAAW;IAC/BO,kBAAkB;QAChBE,SAAS;QACTG,qBAAqB;IACvB;AACF;AAEA,MAAMC,+BAA+Bd,gBAAgB;IACnDe,iBAAiB;IACjBC,cAAc;IACd,GAAGZ,iBAAiBa,QAAQ;AAC9B;AAEA,MAAMC,oBAAoBlB,gBAAgB;IACxCgB,cAAc;AAChB;AAEA;;CAEC,GACD,OAAO,MAAMG,oCAAoC,CAACC;IAChD;IAEA,MAAMC,gBAAgBZ;IACtB,MAAMa,aAAaV;IACnB,MAAMW,4BAA4BT;IAClC,MAAMU,iBAAiBN;IAEvBE,MAAMd,IAAI,CAACmB,SAAS,GAAGvB,aACrBG,0BAA0BC,IAAI,EAC9Be,eACAD,MAAMZ,gBAAgB,IAAIc,WAAWd,gBAAgB,EACrDY,MAAMd,IAAI,CAACmB,SAAS;IAEtBtB,yBAAyB;QACvB,GAAGiB,KAAK;QACRM,QAAQ;QACRC,UAAU;QACVC,cAAc;QACdC,WAAWC;QACXC,UAAU;IACZ;IACA,IAAIX,MAAMb,KAAK,EAAE;QACfa,MAAMb,KAAK,CAACkB,SAAS,GAAGvB,aAAaG,0BAA0BE,KAAK,EAAEiB,gBAAgBJ,MAAMb,KAAK,CAACkB,SAAS;IAC7G;IAEA,IAAIL,MAAMZ,gBAAgB,EAAE;QAC1BY,MAAMZ,gBAAgB,CAACiB,SAAS,GAAGvB,aACjCG,0BAA0BG,gBAAgB,EAC1Ce,2BACAH,MAAMZ,gBAAgB,CAACiB,SAAS;IAEpC;IAEA,OAAOL;AACT,EAAE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { mergeClasses } from '@griffel/react';
|
|
2
|
+
import { useOptionGroupStyles_unstable } from '@fluentui/react-combobox';
|
|
3
|
+
export const tagPickerOptionGroupClassNames = {
|
|
4
|
+
root: 'fui-TagPickerOptionGroup',
|
|
5
|
+
label: 'fui-TagPickerOptionGroup__label'
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Apply styling to the TagPickerOptionGroup slots based on the state
|
|
9
|
+
*/ export const useTagPickerOptionGroupStyles = (state)=>{
|
|
10
|
+
'use no memo';
|
|
11
|
+
useOptionGroupStyles_unstable(state);
|
|
12
|
+
state.root.className = mergeClasses(tagPickerOptionGroupClassNames.root, state.root.className);
|
|
13
|
+
if (state.label) {
|
|
14
|
+
state.label.className = mergeClasses(tagPickerOptionGroupClassNames.label, state.label.className);
|
|
15
|
+
}
|
|
16
|
+
return state;
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerOptionGroup/useTagPickerOptionGroupStyles.styles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerOptionGroupSlots, TagPickerOptionGroupState } from './TagPickerOptionGroup.types';\nimport { useOptionGroupStyles_unstable } from '@fluentui/react-combobox';\n\nexport const tagPickerOptionGroupClassNames: SlotClassNames<TagPickerOptionGroupSlots> = {\n root: 'fui-TagPickerOptionGroup',\n label: 'fui-TagPickerOptionGroup__label',\n};\n\n/**\n * Apply styling to the TagPickerOptionGroup slots based on the state\n */\nexport const useTagPickerOptionGroupStyles = (state: TagPickerOptionGroupState): TagPickerOptionGroupState => {\n 'use no memo';\n\n useOptionGroupStyles_unstable(state);\n state.root.className = mergeClasses(tagPickerOptionGroupClassNames.root, state.root.className);\n\n if (state.label) {\n state.label.className = mergeClasses(tagPickerOptionGroupClassNames.label, state.label.className);\n }\n\n return state;\n};\n"],"names":["mergeClasses","useOptionGroupStyles_unstable","tagPickerOptionGroupClassNames","root","label","useTagPickerOptionGroupStyles","state","className"],"rangeMappings":";;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAG9C,SAASC,6BAA6B,QAAQ,2BAA2B;AAEzE,OAAO,MAAMC,iCAA4E;IACvFC,MAAM;IACNC,OAAO;AACT,EAAE;AAEF;;CAEC,GACD,OAAO,MAAMC,gCAAgC,CAACC;IAC5C;IAEAL,8BAA8BK;IAC9BA,MAAMH,IAAI,CAACI,SAAS,GAAGP,aAAaE,+BAA+BC,IAAI,EAAEG,MAAMH,IAAI,CAACI,SAAS;IAE7F,IAAID,MAAMF,KAAK,EAAE;QACfE,MAAMF,KAAK,CAACG,SAAS,GAAGP,aAAaE,+BAA+BE,KAAK,EAAEE,MAAMF,KAAK,CAACG,SAAS;IAClG;IAEA,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
tagPickerButtonClassNames: function() {
|
|
13
|
+
return tagPickerButtonClassNames;
|
|
14
|
+
},
|
|
15
|
+
useTagPickerButtonStyles_unstable: function() {
|
|
16
|
+
return useTagPickerButtonStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = require("@griffel/react");
|
|
20
|
+
const _reacttheme = require("@fluentui/react-theme");
|
|
21
|
+
const tagPickerButtonClassNames = {
|
|
22
|
+
root: 'fui-TagPickerButton'
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Styles for the root slot
|
|
26
|
+
*/ const useStyles = (0, _react.makeStyles)({
|
|
27
|
+
button: {
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
minHeight: '32px',
|
|
30
|
+
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
|
|
31
|
+
border: 'none',
|
|
32
|
+
boxSizing: 'border-box',
|
|
33
|
+
color: _reacttheme.tokens.colorNeutralForeground1,
|
|
34
|
+
columnGap: _reacttheme.tokens.spacingHorizontalXXS,
|
|
35
|
+
cursor: 'pointer',
|
|
36
|
+
fontFamily: _reacttheme.tokens.fontFamilyBase,
|
|
37
|
+
textAlign: 'left',
|
|
38
|
+
flexGrow: 1,
|
|
39
|
+
'&:focus': {
|
|
40
|
+
outlineStyle: 'none'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
placeholder: {
|
|
44
|
+
color: _reacttheme.tokens.colorNeutralForeground4
|
|
45
|
+
},
|
|
46
|
+
// size variants
|
|
47
|
+
medium: {
|
|
48
|
+
..._reacttheme.typographyStyles.caption1,
|
|
49
|
+
padding: `3px ${_reacttheme.tokens.spacingHorizontalSNudge} 3px ${`calc(${_reacttheme.tokens.spacingHorizontalSNudge} + ${_reacttheme.tokens.spacingHorizontalXXS})`}`
|
|
50
|
+
},
|
|
51
|
+
large: {
|
|
52
|
+
..._reacttheme.typographyStyles.body1,
|
|
53
|
+
padding: `5px ${_reacttheme.tokens.spacingHorizontalMNudge} 5px ${`calc(${_reacttheme.tokens.spacingHorizontalMNudge} + ${_reacttheme.tokens.spacingHorizontalXXS})`}`
|
|
54
|
+
},
|
|
55
|
+
'extra-large': {
|
|
56
|
+
columnGap: _reacttheme.tokens.spacingHorizontalSNudge,
|
|
57
|
+
..._reacttheme.typographyStyles.body2,
|
|
58
|
+
padding: `7px ${_reacttheme.tokens.spacingHorizontalM} 7px ${`calc(${_reacttheme.tokens.spacingHorizontalM} + ${_reacttheme.tokens.spacingHorizontalSNudge})`}`
|
|
59
|
+
},
|
|
60
|
+
// appearance variants
|
|
61
|
+
outline: {
|
|
62
|
+
backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
|
|
63
|
+
border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStroke1}`,
|
|
64
|
+
borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessible
|
|
65
|
+
},
|
|
66
|
+
outlineInteractive: {
|
|
67
|
+
'&:hover': {
|
|
68
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Hover),
|
|
69
|
+
borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessible
|
|
70
|
+
},
|
|
71
|
+
'&:active': {
|
|
72
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Pressed),
|
|
73
|
+
borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessible
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
underline: {
|
|
77
|
+
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
|
|
78
|
+
borderBottom: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStrokeAccessible}`,
|
|
79
|
+
borderRadius: '0'
|
|
80
|
+
},
|
|
81
|
+
'filled-lighter': {
|
|
82
|
+
backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
|
|
83
|
+
border: `${_reacttheme.tokens.strokeWidthThin} solid transparent`
|
|
84
|
+
},
|
|
85
|
+
'filled-darker': {
|
|
86
|
+
backgroundColor: _reacttheme.tokens.colorNeutralBackground3,
|
|
87
|
+
border: `${_reacttheme.tokens.strokeWidthThin} solid transparent`
|
|
88
|
+
},
|
|
89
|
+
invalid: {
|
|
90
|
+
':not(:focus-within),:hover:not(:focus-within)': {
|
|
91
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorPaletteRedBorder2)
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
invalidUnderline: {
|
|
95
|
+
':not(:focus-within),:hover:not(:focus-within)': {
|
|
96
|
+
borderBottomColor: _reacttheme.tokens.colorPaletteRedBorder2
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
disabled: {
|
|
100
|
+
cursor: 'not-allowed',
|
|
101
|
+
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
|
|
102
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStrokeDisabled),
|
|
103
|
+
'@media (forced-colors: active)': {
|
|
104
|
+
..._react.shorthands.borderColor('GrayText')
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
disabledText: {
|
|
108
|
+
color: _reacttheme.tokens.colorNeutralForegroundDisabled,
|
|
109
|
+
cursor: 'not-allowed'
|
|
110
|
+
},
|
|
111
|
+
hidden: {
|
|
112
|
+
display: 'none'
|
|
113
|
+
},
|
|
114
|
+
visuallyHidden: {
|
|
115
|
+
clip: 'rect(0px, 0px, 0px, 0px)',
|
|
116
|
+
height: '1px',
|
|
117
|
+
margin: '-1px',
|
|
118
|
+
overflow: 'hidden',
|
|
119
|
+
padding: '0px',
|
|
120
|
+
width: '1px',
|
|
121
|
+
position: 'absolute'
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
const useTagPickerButtonStyles_unstable = (state)=>{
|
|
125
|
+
'use no memo';
|
|
126
|
+
const styles = useStyles();
|
|
127
|
+
state.root.className = (0, _react.mergeClasses)(tagPickerButtonClassNames.root, styles.button, styles[state.size], state.hasSelectedOption && styles.visuallyHidden, state.root.className);
|
|
128
|
+
return state;
|
|
129
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerButton/useTagPickerButtonStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerButtonSlots, TagPickerButtonState } from './TagPickerButton.types';\n\nexport const tagPickerButtonClassNames: SlotClassNames<TagPickerButtonSlots> = {\n root: 'fui-TagPickerButton',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n button: {\n alignItems: 'center',\n minHeight: '32px',\n backgroundColor: tokens.colorTransparentBackground,\n border: 'none',\n boxSizing: 'border-box',\n color: tokens.colorNeutralForeground1,\n columnGap: tokens.spacingHorizontalXXS,\n cursor: 'pointer',\n fontFamily: tokens.fontFamilyBase,\n textAlign: 'left',\n flexGrow: 1,\n\n '&:focus': {\n outlineStyle: 'none',\n },\n },\n\n placeholder: {\n color: tokens.colorNeutralForeground4,\n },\n\n // size variants\n medium: {\n ...typographyStyles.caption1,\n padding: `3px ${\n tokens.spacingHorizontalSNudge\n } 3px ${`calc(${tokens.spacingHorizontalSNudge} + ${tokens.spacingHorizontalXXS})`}`,\n },\n large: {\n ...typographyStyles.body1,\n padding: `5px ${\n tokens.spacingHorizontalMNudge\n } 5px ${`calc(${tokens.spacingHorizontalMNudge} + ${tokens.spacingHorizontalXXS})`}`,\n },\n 'extra-large': {\n columnGap: tokens.spacingHorizontalSNudge,\n ...typographyStyles.body2,\n padding: `7px ${\n tokens.spacingHorizontalM\n } 7px ${`calc(${tokens.spacingHorizontalM} + ${tokens.spacingHorizontalSNudge})`}`,\n },\n\n // appearance variants\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n outlineInteractive: {\n '&:hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n\n '&:active': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeAccessible}`,\n borderRadius: '0',\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid transparent`,\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid transparent`,\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n invalidUnderline: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n borderBottomColor: tokens.colorPaletteRedBorder2,\n },\n },\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n\n disabledText: {\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n },\n\n hidden: {\n display: 'none',\n },\n visuallyHidden: {\n clip: 'rect(0px, 0px, 0px, 0px)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: '0px',\n width: '1px',\n position: 'absolute',\n },\n});\n\n/**\n * Apply styling to the PickerButton slots based on the state\n */\nexport const useTagPickerButtonStyles_unstable = (state: TagPickerButtonState): TagPickerButtonState => {\n 'use no memo';\n\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerButtonClassNames.root,\n styles.button,\n styles[state.size],\n state.hasSelectedOption && styles.visuallyHidden,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["tagPickerButtonClassNames","useTagPickerButtonStyles_unstable","root","useStyles","makeStyles","button","alignItems","minHeight","backgroundColor","tokens","colorTransparentBackground","border","boxSizing","color","colorNeutralForeground1","columnGap","spacingHorizontalXXS","cursor","fontFamily","fontFamilyBase","textAlign","flexGrow","outlineStyle","placeholder","colorNeutralForeground4","medium","typographyStyles","caption1","padding","spacingHorizontalSNudge","large","body1","spacingHorizontalMNudge","body2","spacingHorizontalM","outline","colorNeutralBackground1","strokeWidthThin","colorNeutralStroke1","borderBottomColor","colorNeutralStrokeAccessible","outlineInteractive","shorthands","borderColor","colorNeutralStroke1Hover","colorNeutralStroke1Pressed","underline","borderBottom","borderRadius","colorNeutralBackground3","invalid","colorPaletteRedBorder2","invalidUnderline","disabled","colorNeutralStrokeDisabled","disabledText","colorNeutralForegroundDisabled","hidden","display","visuallyHidden","clip","height","margin","overflow","width","position","state","styles","className","mergeClasses","size","hasSelectedOption"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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iD;YAC/Cb,mBAAmB9B,kBAAAA,CAAO0C,sBAAsB;QAClD;IACF;IACAE,UAAU;QACRpC,QAAQ;QACRT,iBAAiBC,kBAAAA,CAAOC,0BAA0B;QAClD,GAAGgC,iBAAAA,CAAWC,WAAW,CAAClC,kBAAAA,CAAO6C,0BAA0B,CAAC;QAC5D,kCAAkC;YAChC,GAAGZ,iBAAAA,CAAWC,WAAW,CAAC,WAAW;QACvC;IACF;IAEAY,cAAc;QACZ1C,OAAOJ,kBAAAA,CAAO+C,8BAA8B;QAC5CvC,QAAQ;IACV;IAEAwC,QAAQ;QACNC,SAAS;IACX;IACAC,gBAAgB;QACdC,MAAM;QACNC,QAAQ;QACRC,QAAQ;QACRC,UAAU;QACVnC,SAAS;QACToC,OAAO;QACPC,UAAU;IACZ;AACF;AAKO,MAAMhE,oCAAoC,CAACiE;IAChD;IAEA,MAAMC,SAAShE;IACf+D,MAAMhE,IAAI,CAACkE,SAAS,GAAGC,IAAAA,mBAAAA,EACrBrE,0BAA0BE,IAAI,EAC9BiE,OAAO9D,MAAM,EACb8D,MAAM,CAACD,MAAMI,IAAI,CAAC,EAClBJ,MAAMK,iBAAiB,IAAIJ,OAAOR,cAAc,EAChDO,MAAMhE,IAAI,CAACkE,SAAS;IAGtB,OAAOF;AACT"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
iconSizes: function() {
|
|
13
|
+
return iconSizes;
|
|
14
|
+
},
|
|
15
|
+
tagPickerControlAsideWidthToken: function() {
|
|
16
|
+
return tagPickerControlAsideWidthToken;
|
|
17
|
+
},
|
|
18
|
+
tagPickerControlClassNames: function() {
|
|
19
|
+
return tagPickerControlClassNames;
|
|
20
|
+
},
|
|
21
|
+
useTagPickerControlStyles_unstable: function() {
|
|
22
|
+
return useTagPickerControlStyles_unstable;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const _react = require("@griffel/react");
|
|
26
|
+
const _reacttheme = require("@fluentui/react-theme");
|
|
27
|
+
const tagPickerControlClassNames = {
|
|
28
|
+
root: 'fui-TagPickerControl',
|
|
29
|
+
expandIcon: 'fui-TagPickerControl__expandIcon',
|
|
30
|
+
secondaryAction: 'fui-TagPickerControl__secondaryAction',
|
|
31
|
+
aside: 'fui-TagPickerControl__aside'
|
|
32
|
+
};
|
|
33
|
+
const tagPickerControlAsideWidthToken = '--fui-TagPickerControl-aside-width';
|
|
34
|
+
/**
|
|
35
|
+
* Styles for the root slot
|
|
36
|
+
*/ const useStyles = (0, _react.makeStyles)({
|
|
37
|
+
root: {
|
|
38
|
+
borderRadius: _reacttheme.tokens.borderRadiusMedium,
|
|
39
|
+
paddingRight: `calc(${_reacttheme.tokens.spacingHorizontalM} + var(${tagPickerControlAsideWidthToken}, 0px))`,
|
|
40
|
+
paddingLeft: _reacttheme.tokens.spacingHorizontalM,
|
|
41
|
+
alignItems: 'center',
|
|
42
|
+
columnGap: _reacttheme.tokens.spacingHorizontalXXS,
|
|
43
|
+
boxSizing: 'border-box',
|
|
44
|
+
display: 'flex',
|
|
45
|
+
minWidth: '250px',
|
|
46
|
+
position: 'relative',
|
|
47
|
+
flexWrap: 'wrap',
|
|
48
|
+
// windows high contrast mode focus indicator
|
|
49
|
+
':focus-within': {
|
|
50
|
+
outlineWidth: '2px',
|
|
51
|
+
outlineStyle: 'solid',
|
|
52
|
+
outlineColor: 'transparent'
|
|
53
|
+
},
|
|
54
|
+
// bottom focus border, shared with Input, Select, and SpinButton
|
|
55
|
+
'::after': {
|
|
56
|
+
boxSizing: 'border-box',
|
|
57
|
+
content: '""',
|
|
58
|
+
position: 'absolute',
|
|
59
|
+
left: '-1px',
|
|
60
|
+
bottom: '-1px',
|
|
61
|
+
right: '-1px',
|
|
62
|
+
height: `max(2px, ${_reacttheme.tokens.borderRadiusMedium})`,
|
|
63
|
+
borderBottomLeftRadius: _reacttheme.tokens.borderRadiusMedium,
|
|
64
|
+
borderBottomRightRadius: _reacttheme.tokens.borderRadiusMedium,
|
|
65
|
+
borderBottom: `${_reacttheme.tokens.strokeWidthThick} solid ${_reacttheme.tokens.colorCompoundBrandStroke}`,
|
|
66
|
+
clipPath: 'inset(calc(100% - 2px) 0 0 0)',
|
|
67
|
+
transform: 'scaleX(0)',
|
|
68
|
+
transitionProperty: 'transform',
|
|
69
|
+
transitionDuration: _reacttheme.tokens.durationUltraFast,
|
|
70
|
+
transitionDelay: _reacttheme.tokens.curveAccelerateMid,
|
|
71
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
72
|
+
transitionDuration: '0.01ms',
|
|
73
|
+
transitionDelay: '0.01ms'
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
':focus-within::after': {
|
|
77
|
+
transform: 'scaleX(1)',
|
|
78
|
+
transitionProperty: 'transform',
|
|
79
|
+
transitionDuration: _reacttheme.tokens.durationNormal,
|
|
80
|
+
transitionDelay: _reacttheme.tokens.curveDecelerateMid,
|
|
81
|
+
'@media screen and (prefers-reduced-motion: reduce)': {
|
|
82
|
+
transitionDuration: '0.01ms',
|
|
83
|
+
transitionDelay: '0.01ms'
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
':focus-within:active::after': {
|
|
87
|
+
borderBottomColor: _reacttheme.tokens.colorCompoundBrandStrokePressed
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
listbox: {
|
|
91
|
+
boxShadow: `${_reacttheme.tokens.shadow16}`,
|
|
92
|
+
borderRadius: _reacttheme.tokens.borderRadiusMedium,
|
|
93
|
+
maxHeight: '80vh',
|
|
94
|
+
boxSizing: 'border-box'
|
|
95
|
+
},
|
|
96
|
+
listboxCollapsed: {
|
|
97
|
+
display: 'none'
|
|
98
|
+
},
|
|
99
|
+
// size variants
|
|
100
|
+
medium: {
|
|
101
|
+
minHeight: '32px'
|
|
102
|
+
},
|
|
103
|
+
large: {
|
|
104
|
+
minHeight: '40px'
|
|
105
|
+
},
|
|
106
|
+
'extra-large': {
|
|
107
|
+
minHeight: '44px'
|
|
108
|
+
},
|
|
109
|
+
// appearance variants
|
|
110
|
+
outline: {
|
|
111
|
+
backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
|
|
112
|
+
border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStroke1}`,
|
|
113
|
+
borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessible
|
|
114
|
+
},
|
|
115
|
+
outlineInteractive: {
|
|
116
|
+
'&:hover': {
|
|
117
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Hover),
|
|
118
|
+
borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessibleHover
|
|
119
|
+
},
|
|
120
|
+
'&:active': {
|
|
121
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Pressed),
|
|
122
|
+
borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessiblePressed
|
|
123
|
+
},
|
|
124
|
+
'&:focus-within': {
|
|
125
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStroke1Pressed),
|
|
126
|
+
borderBottomColor: _reacttheme.tokens.colorNeutralStrokeAccessiblePressed
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
underline: {
|
|
130
|
+
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
|
|
131
|
+
borderBottom: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorNeutralStrokeAccessible}`,
|
|
132
|
+
borderRadius: '0'
|
|
133
|
+
},
|
|
134
|
+
'filled-lighter': {
|
|
135
|
+
backgroundColor: _reacttheme.tokens.colorNeutralBackground1,
|
|
136
|
+
border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorTransparentStroke}`
|
|
137
|
+
},
|
|
138
|
+
'filled-darker': {
|
|
139
|
+
backgroundColor: _reacttheme.tokens.colorNeutralBackground3,
|
|
140
|
+
border: `${_reacttheme.tokens.strokeWidthThin} solid ${_reacttheme.tokens.colorTransparentStroke}`
|
|
141
|
+
},
|
|
142
|
+
invalid: {
|
|
143
|
+
':not(:focus-within),:hover:not(:focus-within)': {
|
|
144
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorPaletteRedBorder2)
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
invalidUnderline: {
|
|
148
|
+
':not(:focus-within),:hover:not(:focus-within)': {
|
|
149
|
+
borderBottomColor: _reacttheme.tokens.colorPaletteRedBorder2
|
|
150
|
+
}
|
|
151
|
+
},
|
|
152
|
+
disabled: {
|
|
153
|
+
cursor: 'not-allowed',
|
|
154
|
+
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
|
|
155
|
+
..._react.shorthands.borderColor(_reacttheme.tokens.colorNeutralStrokeDisabled),
|
|
156
|
+
'@media (forced-colors: active)': {
|
|
157
|
+
..._react.shorthands.borderColor('GrayText')
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const useAsideStyles = (0, _react.makeStyles)({
|
|
162
|
+
root: {
|
|
163
|
+
display: 'flex',
|
|
164
|
+
position: 'absolute',
|
|
165
|
+
top: '0',
|
|
166
|
+
right: _reacttheme.tokens.spacingHorizontalM,
|
|
167
|
+
height: '100%',
|
|
168
|
+
cursor: 'text'
|
|
169
|
+
},
|
|
170
|
+
// size variants
|
|
171
|
+
medium: {
|
|
172
|
+
minHeight: '32px'
|
|
173
|
+
},
|
|
174
|
+
large: {
|
|
175
|
+
minHeight: '40px'
|
|
176
|
+
},
|
|
177
|
+
'extra-large': {
|
|
178
|
+
minHeight: '44px'
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
const iconSizes = {
|
|
182
|
+
small: '16px',
|
|
183
|
+
medium: '20px',
|
|
184
|
+
large: '24px'
|
|
185
|
+
};
|
|
186
|
+
const useIconStyles = (0, _react.makeStyles)({
|
|
187
|
+
icon: {
|
|
188
|
+
boxSizing: 'border-box',
|
|
189
|
+
color: _reacttheme.tokens.colorNeutralStrokeAccessible,
|
|
190
|
+
cursor: 'pointer',
|
|
191
|
+
display: 'flex',
|
|
192
|
+
justifyContent: 'center',
|
|
193
|
+
alignItems: 'center',
|
|
194
|
+
alignSelf: 'flex-start',
|
|
195
|
+
fontSize: _reacttheme.tokens.fontSizeBase500,
|
|
196
|
+
// the SVG must have display: block for accurate positioning
|
|
197
|
+
// otherwise an extra inline space is inserted after the svg element
|
|
198
|
+
'& svg': {
|
|
199
|
+
display: 'block'
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
// icon size variants
|
|
203
|
+
medium: {
|
|
204
|
+
fontSize: iconSizes.small,
|
|
205
|
+
marginLeft: _reacttheme.tokens.spacingHorizontalXXS,
|
|
206
|
+
minHeight: '32px'
|
|
207
|
+
},
|
|
208
|
+
large: {
|
|
209
|
+
fontSize: iconSizes.medium,
|
|
210
|
+
marginLeft: _reacttheme.tokens.spacingHorizontalXXS,
|
|
211
|
+
minHeight: '40px'
|
|
212
|
+
},
|
|
213
|
+
'extra-large': {
|
|
214
|
+
fontSize: iconSizes.large,
|
|
215
|
+
marginLeft: _reacttheme.tokens.spacingHorizontalSNudge,
|
|
216
|
+
minHeight: '44px'
|
|
217
|
+
},
|
|
218
|
+
disabled: {
|
|
219
|
+
color: _reacttheme.tokens.colorNeutralForegroundDisabled,
|
|
220
|
+
cursor: 'not-allowed'
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
const useSecondaryActionStyles = (0, _react.makeStyles)({
|
|
224
|
+
root: {
|
|
225
|
+
display: 'flex'
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
const useTagPickerControlStyles_unstable = (state)=>{
|
|
229
|
+
'use no memo';
|
|
230
|
+
const styles = useStyles();
|
|
231
|
+
const iconStyles = useIconStyles();
|
|
232
|
+
const asideStyles = useAsideStyles();
|
|
233
|
+
const secondaryActionStyles = useSecondaryActionStyles();
|
|
234
|
+
state.root.className = (0, _react.mergeClasses)(tagPickerControlClassNames.root, styles.root, styles[state.size], styles[state.appearance], !state.disabled && state.appearance === 'outline' && styles.outlineInteractive, state.invalid && state.appearance !== 'underline' && styles.invalid, state.invalid && state.appearance === 'underline' && styles.invalidUnderline, state.disabled && styles.disabled, state.root.className);
|
|
235
|
+
if (state.aside) {
|
|
236
|
+
state.aside.className = (0, _react.mergeClasses)(tagPickerControlClassNames.aside, asideStyles.root, asideStyles[state.size], state.aside.className);
|
|
237
|
+
}
|
|
238
|
+
if (state.expandIcon) {
|
|
239
|
+
state.expandIcon.className = (0, _react.mergeClasses)(tagPickerControlClassNames.expandIcon, iconStyles.icon, iconStyles[state.size], state.disabled && iconStyles.disabled, state.expandIcon.className);
|
|
240
|
+
}
|
|
241
|
+
if (state.secondaryAction) {
|
|
242
|
+
state.secondaryAction.className = (0, _react.mergeClasses)(tagPickerControlClassNames.secondaryAction, secondaryActionStyles.root, state.secondaryAction.className);
|
|
243
|
+
}
|
|
244
|
+
return state;
|
|
245
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerControl/useTagPickerControlStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses, shorthands } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\nimport type {\n TagPickerControlInternalSlots,\n TagPickerControlSlots,\n TagPickerControlState,\n} from './TagPickerControl.types';\n\nexport const tagPickerControlClassNames: SlotClassNames<TagPickerControlSlots & TagPickerControlInternalSlots> = {\n root: 'fui-TagPickerControl',\n expandIcon: 'fui-TagPickerControl__expandIcon',\n secondaryAction: 'fui-TagPickerControl__secondaryAction',\n aside: 'fui-TagPickerControl__aside',\n};\n\nexport const tagPickerControlAsideWidthToken = '--fui-TagPickerControl-aside-width' as const;\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n borderRadius: tokens.borderRadiusMedium,\n paddingRight: `calc(${tokens.spacingHorizontalM} + var(${tagPickerControlAsideWidthToken}, 0px))`,\n paddingLeft: tokens.spacingHorizontalM,\n alignItems: 'center',\n columnGap: tokens.spacingHorizontalXXS,\n boxSizing: 'border-box',\n display: 'flex',\n minWidth: '250px',\n position: 'relative',\n flexWrap: 'wrap',\n\n // windows high contrast mode focus indicator\n ':focus-within': {\n outlineWidth: '2px',\n outlineStyle: 'solid',\n outlineColor: 'transparent',\n },\n\n // bottom focus border, shared with Input, Select, and SpinButton\n '::after': {\n boxSizing: 'border-box',\n content: '\"\"',\n position: 'absolute',\n left: '-1px',\n bottom: '-1px',\n right: '-1px',\n height: `max(2px, ${tokens.borderRadiusMedium})`,\n borderBottomLeftRadius: tokens.borderRadiusMedium,\n borderBottomRightRadius: tokens.borderRadiusMedium,\n borderBottom: `${tokens.strokeWidthThick} solid ${tokens.colorCompoundBrandStroke}`,\n clipPath: 'inset(calc(100% - 2px) 0 0 0)',\n transform: 'scaleX(0)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationUltraFast,\n transitionDelay: tokens.curveAccelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within::after': {\n transform: 'scaleX(1)',\n transitionProperty: 'transform',\n transitionDuration: tokens.durationNormal,\n transitionDelay: tokens.curveDecelerateMid,\n\n '@media screen and (prefers-reduced-motion: reduce)': {\n transitionDuration: '0.01ms',\n transitionDelay: '0.01ms',\n },\n },\n ':focus-within:active::after': {\n borderBottomColor: tokens.colorCompoundBrandStrokePressed,\n },\n },\n\n listbox: {\n boxShadow: `${tokens.shadow16}`,\n borderRadius: tokens.borderRadiusMedium,\n maxHeight: '80vh',\n boxSizing: 'border-box',\n },\n\n listboxCollapsed: {\n display: 'none',\n },\n\n // size variants\n medium: {\n minHeight: '32px',\n },\n large: {\n minHeight: '40px',\n },\n 'extra-large': {\n minHeight: '44px',\n },\n\n // appearance variants\n outline: {\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStroke1}`,\n borderBottomColor: tokens.colorNeutralStrokeAccessible,\n },\n\n outlineInteractive: {\n '&:hover': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Hover),\n borderBottomColor: tokens.colorNeutralStrokeAccessibleHover,\n },\n\n '&:active': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n\n '&:focus-within': {\n ...shorthands.borderColor(tokens.colorNeutralStroke1Pressed),\n borderBottomColor: tokens.colorNeutralStrokeAccessiblePressed,\n },\n },\n underline: {\n backgroundColor: tokens.colorTransparentBackground,\n borderBottom: `${tokens.strokeWidthThin} solid ${tokens.colorNeutralStrokeAccessible}`,\n borderRadius: '0',\n },\n 'filled-lighter': {\n backgroundColor: tokens.colorNeutralBackground1,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n },\n 'filled-darker': {\n backgroundColor: tokens.colorNeutralBackground3,\n border: `${tokens.strokeWidthThin} solid ${tokens.colorTransparentStroke}`,\n },\n invalid: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n ...shorthands.borderColor(tokens.colorPaletteRedBorder2),\n },\n },\n invalidUnderline: {\n ':not(:focus-within),:hover:not(:focus-within)': {\n borderBottomColor: tokens.colorPaletteRedBorder2,\n },\n },\n\n disabled: {\n cursor: 'not-allowed',\n backgroundColor: tokens.colorTransparentBackground,\n ...shorthands.borderColor(tokens.colorNeutralStrokeDisabled),\n '@media (forced-colors: active)': {\n ...shorthands.borderColor('GrayText'),\n },\n },\n});\n\nconst useAsideStyles = makeStyles({\n root: {\n display: 'flex',\n position: 'absolute',\n top: '0',\n right: tokens.spacingHorizontalM,\n height: '100%',\n cursor: 'text',\n },\n // size variants\n medium: {\n minHeight: '32px',\n },\n large: {\n minHeight: '40px',\n },\n 'extra-large': {\n minHeight: '44px',\n },\n});\n\nexport const iconSizes = {\n small: '16px',\n medium: '20px',\n large: '24px',\n};\n\nconst useIconStyles = makeStyles({\n icon: {\n boxSizing: 'border-box',\n color: tokens.colorNeutralStrokeAccessible,\n cursor: 'pointer',\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n alignSelf: 'flex-start',\n fontSize: tokens.fontSizeBase500,\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 // icon size variants\n medium: {\n fontSize: iconSizes.small,\n marginLeft: tokens.spacingHorizontalXXS,\n minHeight: '32px',\n },\n large: {\n fontSize: iconSizes.medium,\n marginLeft: tokens.spacingHorizontalXXS,\n minHeight: '40px',\n },\n 'extra-large': {\n fontSize: iconSizes.large,\n marginLeft: tokens.spacingHorizontalSNudge,\n minHeight: '44px',\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n cursor: 'not-allowed',\n },\n});\n\nconst useSecondaryActionStyles = makeStyles({\n root: { display: 'flex' },\n});\n\n/**\n * Apply styling to the PickerControl slots based on the state\n */\nexport const useTagPickerControlStyles_unstable = (state: TagPickerControlState): TagPickerControlState => {\n 'use no memo';\n\n const styles = useStyles();\n const iconStyles = useIconStyles();\n const asideStyles = useAsideStyles();\n const secondaryActionStyles = useSecondaryActionStyles();\n state.root.className = mergeClasses(\n tagPickerControlClassNames.root,\n styles.root,\n styles[state.size],\n styles[state.appearance],\n !state.disabled && state.appearance === 'outline' && styles.outlineInteractive,\n state.invalid && state.appearance !== 'underline' && styles.invalid,\n state.invalid && state.appearance === 'underline' && styles.invalidUnderline,\n state.disabled && styles.disabled,\n state.root.className,\n );\n\n if (state.aside) {\n state.aside.className = mergeClasses(\n tagPickerControlClassNames.aside,\n asideStyles.root,\n asideStyles[state.size],\n state.aside.className,\n );\n }\n\n if (state.expandIcon) {\n state.expandIcon.className = mergeClasses(\n tagPickerControlClassNames.expandIcon,\n iconStyles.icon,\n iconStyles[state.size],\n state.disabled && iconStyles.disabled,\n state.expandIcon.className,\n );\n }\n\n if (state.secondaryAction) {\n state.secondaryAction.className = mergeClasses(\n tagPickerControlClassNames.secondaryAction,\n secondaryActionStyles.root,\n state.secondaryAction.className,\n );\n }\n\n return state;\n};\n"],"names":["iconSizes","tagPickerControlAsideWidthToken","tagPickerControlClassNames","useTagPickerControlStyles_unstable","root","expandIcon","secondaryAction","aside","useStyles","makeStyles","borderRadius","tokens","borderRadiusMedium","paddingRight","spacingHorizontalM","paddingLeft","alignItems","columnGap","spacingHorizontalXXS","boxSizing","display","minWidth","position","flexWrap","outlineWidth","outlineStyle","outlineColor","content","left","bottom","right","height","borderBottomLeftRadius","borderBottomRightRadius","borderBottom","strokeWidthThick","colorCompoundBrandStroke","clipPath","transform","transitionProperty","transitionDuration","durationUltraFast","transitionDelay","curveAccelerateMid","durationNormal","curveDecelerateMid","borderBottomColor","colorCompoundBrandStrokePressed","listbox","boxShadow","shadow16","maxHeight","listboxCollapsed","medium","minHeight","large","outline","backgroundColor","colorNeutralBackground1","border","strokeWidthThin","colorNeutralStroke1","colorNeutralStrokeAccessible","outlineInteractive","shorthands","borderColor","colorNeutralStroke1Hover","colorNeutralStrokeAccessibleHover","colorNeutralStroke1Pressed","colorNeutralStrokeAccessiblePressed","underline","colorTransparentBackground","colorTransparentStroke","colorNeutralBackground3","invalid","colorPaletteRedBorder2","invalidUnderline","disabled","cursor","colorNeutralStrokeDisabled","useAsideStyles","top","small","useIconStyles","icon","color","justifyContent","alignSelf","fontSize","fontSizeBase500","marginLeft","spacingHorizontalSNudge","colorNeutralForegroundDisabled","useSecondaryActionStyles","state","styles","iconStyles","asideStyles","secondaryActionStyles","className","mergeClasses","size","appearance"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;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
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
tagPickerGroupClassNames: function() {
|
|
13
|
+
return tagPickerGroupClassNames;
|
|
14
|
+
},
|
|
15
|
+
useTagPickerGroupStyles_unstable: function() {
|
|
16
|
+
return useTagPickerGroupStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = require("@griffel/react");
|
|
20
|
+
const _reacttags = require("@fluentui/react-tags");
|
|
21
|
+
const _reacttheme = require("@fluentui/react-theme");
|
|
22
|
+
const _tagPicker2Tag = require("../../utils/tagPicker2Tag");
|
|
23
|
+
const tagPickerGroupClassNames = {
|
|
24
|
+
root: 'fui-TagPickerGroup'
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Styles for the root slot
|
|
28
|
+
*/ const useStyles = (0, _react.makeStyles)({
|
|
29
|
+
root: {
|
|
30
|
+
flexWrap: 'wrap',
|
|
31
|
+
boxSizing: 'border-box',
|
|
32
|
+
cursor: 'text'
|
|
33
|
+
},
|
|
34
|
+
// size variants
|
|
35
|
+
medium: {
|
|
36
|
+
padding: `${_reacttheme.tokens.spacingVerticalSNudge} 0 ${_reacttheme.tokens.spacingVerticalSNudge} 0`,
|
|
37
|
+
gap: _reacttheme.tokens.spacingHorizontalXS
|
|
38
|
+
},
|
|
39
|
+
large: {
|
|
40
|
+
padding: `${_reacttheme.tokens.spacingVerticalS} 0 ${_reacttheme.tokens.spacingVerticalS} 0`,
|
|
41
|
+
gap: _reacttheme.tokens.spacingHorizontalSNudge
|
|
42
|
+
},
|
|
43
|
+
'extra-large': {
|
|
44
|
+
padding: `${_reacttheme.tokens.spacingVerticalS} 0 ${_reacttheme.tokens.spacingVerticalS} 0`,
|
|
45
|
+
gap: _reacttheme.tokens.spacingHorizontalSNudge
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
const useTagPickerGroupStyles_unstable = (state)=>{
|
|
49
|
+
'use no memo';
|
|
50
|
+
(0, _reacttags.useTagGroupStyles_unstable)(state);
|
|
51
|
+
const styles = useStyles();
|
|
52
|
+
state.root.className = (0, _react.mergeClasses)(tagPickerGroupClassNames.root, styles[(0, _tagPicker2Tag.tagSizeToTagPickerSize)(state.size)], styles.root, state.root.className);
|
|
53
|
+
return state;
|
|
54
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerGroup/useTagPickerGroupStyles.styles.ts"],"sourcesContent":["import { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerGroupSlots, TagPickerGroupState } from './TagPickerGroup.types';\nimport { useTagGroupStyles_unstable } from '@fluentui/react-tags';\nimport { tokens } from '@fluentui/react-theme';\nimport { tagSizeToTagPickerSize } from '../../utils/tagPicker2Tag';\n\nexport const tagPickerGroupClassNames: SlotClassNames<TagPickerGroupSlots> = {\n root: 'fui-TagPickerGroup',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n flexWrap: 'wrap',\n boxSizing: 'border-box',\n cursor: 'text',\n },\n // size variants\n medium: {\n padding: `${tokens.spacingVerticalSNudge} 0 ${tokens.spacingVerticalSNudge} 0`,\n gap: tokens.spacingHorizontalXS,\n },\n large: {\n padding: `${tokens.spacingVerticalS} 0 ${tokens.spacingVerticalS} 0`,\n gap: tokens.spacingHorizontalSNudge,\n },\n 'extra-large': {\n padding: `${tokens.spacingVerticalS} 0 ${tokens.spacingVerticalS} 0`,\n gap: tokens.spacingHorizontalSNudge,\n },\n});\n\n/**\n * Apply styling to the TagPickerGroup slots based on the state\n */\nexport const useTagPickerGroupStyles_unstable = (state: TagPickerGroupState): TagPickerGroupState => {\n 'use no memo';\n\n useTagGroupStyles_unstable(state);\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerGroupClassNames.root,\n styles[tagSizeToTagPickerSize(state.size)],\n styles.root,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["tagPickerGroupClassNames","useTagPickerGroupStyles_unstable","root","useStyles","makeStyles","flexWrap","boxSizing","cursor","medium","padding","tokens","spacingVerticalSNudge","gap","spacingHorizontalXS","large","spacingVerticalS","spacingHorizontalSNudge","state","useTagGroupStyles_unstable","styles","className","mergeClasses","tagSizeToTagPickerSize","size"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAOaA,wBAAAA;eAAAA;;IA+BAC,gCAAAA;eAAAA;;;uBAtC4B;2BAGE;4BACpB;+BACgB;AAEhC,MAAMD,2BAAgE;IAC3EE,MAAM;AACR;AAEA;;CAEC,GACD,MAAMC,YAAYC,IAAAA,iBAAAA,EAAW;IAC3BF,MAAM;QACJG,UAAU;QACVC,WAAW;QACXC,QAAQ;IACV;IACA,gBAAgB;IAChBC,QAAQ;QACNC,SAAS,CAAC,EAAEC,kBAAAA,CAAOC,qBAAqB,CAAC,GAAG,EAAED,kBAAAA,CAAOC,qBAAqB,CAAC,EAAE,CAAC;QAC9EC,KAAKF,kBAAAA,CAAOG,mBAAmB;IACjC;IACAC,OAAO;QACLL,SAAS,CAAC,EAAEC,kBAAAA,CAAOK,gBAAgB,CAAC,GAAG,EAAEL,kBAAAA,CAAOK,gBAAgB,CAAC,EAAE,CAAC;QACpEH,KAAKF,kBAAAA,CAAOM,uBAAuB;IACrC;IACA,eAAe;QACbP,SAAS,CAAC,EAAEC,kBAAAA,CAAOK,gBAAgB,CAAC,GAAG,EAAEL,kBAAAA,CAAOK,gBAAgB,CAAC,EAAE,CAAC;QACpEH,KAAKF,kBAAAA,CAAOM,uBAAuB;IACrC;AACF;AAKO,MAAMf,mCAAmC,CAACgB;IAC/C;IAEAC,IAAAA,qCAAAA,EAA2BD;IAC3B,MAAME,SAAShB;IACfc,MAAMf,IAAI,CAACkB,SAAS,GAAGC,IAAAA,mBAAAA,EACrBrB,yBAAyBE,IAAI,EAC7BiB,MAAM,CAACG,IAAAA,qCAAAA,EAAuBL,MAAMM,IAAI,EAAE,EAC1CJ,OAAOjB,IAAI,EACXe,MAAMf,IAAI,CAACkB,SAAS;IAGtB,OAAOH;AACT"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
tagPickerInputClassNames: function() {
|
|
13
|
+
return tagPickerInputClassNames;
|
|
14
|
+
},
|
|
15
|
+
useTagPickerInputStyles_unstable: function() {
|
|
16
|
+
return useTagPickerInputStyles_unstable;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _react = require("@griffel/react");
|
|
20
|
+
const _reacttheme = require("@fluentui/react-theme");
|
|
21
|
+
const _tokens = require("../../utils/tokens");
|
|
22
|
+
const tagPickerInputClassNames = {
|
|
23
|
+
root: 'fui-TagPickerInput'
|
|
24
|
+
};
|
|
25
|
+
const useBaseStyle = (0, _react.makeResetStyles)({
|
|
26
|
+
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
|
|
27
|
+
color: _reacttheme.tokens.colorNeutralForeground1,
|
|
28
|
+
fontFamily: _reacttheme.tokens.fontFamilyBase,
|
|
29
|
+
boxSizing: 'border-box',
|
|
30
|
+
'&:focus': {
|
|
31
|
+
outlineStyle: 'none'
|
|
32
|
+
},
|
|
33
|
+
'&::placeholder': {
|
|
34
|
+
color: _reacttheme.tokens.colorNeutralForeground4,
|
|
35
|
+
opacity: 1
|
|
36
|
+
},
|
|
37
|
+
'&::after': {
|
|
38
|
+
visibility: 'hidden',
|
|
39
|
+
whiteSpace: 'pre-wrap'
|
|
40
|
+
},
|
|
41
|
+
border: 'none',
|
|
42
|
+
minWidth: '24px',
|
|
43
|
+
maxWidth: '100%',
|
|
44
|
+
// by default width is 0,
|
|
45
|
+
// it will be calculated based on the requirement of stretching the component to 100% width
|
|
46
|
+
// see setTagPickerInputStretchStyle method for more details
|
|
47
|
+
width: _tokens.tagPickerInputTokens.width,
|
|
48
|
+
flexGrow: 1
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* Styles for the root slot
|
|
52
|
+
*/ const useStyles = (0, _react.makeStyles)({
|
|
53
|
+
// size variants
|
|
54
|
+
medium: {
|
|
55
|
+
..._reacttheme.typographyStyles.body1,
|
|
56
|
+
padding: `${_reacttheme.tokens.spacingVerticalSNudge} 0 ${_reacttheme.tokens.spacingVerticalSNudge} 0`
|
|
57
|
+
},
|
|
58
|
+
large: {
|
|
59
|
+
..._reacttheme.typographyStyles.body1,
|
|
60
|
+
padding: `${_reacttheme.tokens.spacingVerticalMNudge} 0 ${_reacttheme.tokens.spacingVerticalMNudge} 0`
|
|
61
|
+
},
|
|
62
|
+
'extra-large': {
|
|
63
|
+
..._reacttheme.typographyStyles.body1,
|
|
64
|
+
padding: `${_reacttheme.tokens.spacingVerticalM} 0 ${_reacttheme.tokens.spacingVerticalM} 0`
|
|
65
|
+
},
|
|
66
|
+
disabled: {
|
|
67
|
+
color: _reacttheme.tokens.colorNeutralForegroundDisabled,
|
|
68
|
+
backgroundColor: _reacttheme.tokens.colorTransparentBackground,
|
|
69
|
+
cursor: 'not-allowed',
|
|
70
|
+
'::placeholder': {
|
|
71
|
+
color: _reacttheme.tokens.colorNeutralForegroundDisabled
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
const useTagPickerInputStyles_unstable = (state)=>{
|
|
76
|
+
'use no memo';
|
|
77
|
+
const baseStyle = useBaseStyle();
|
|
78
|
+
const styles = useStyles();
|
|
79
|
+
state.root.className = (0, _react.mergeClasses)(tagPickerInputClassNames.root, baseStyle, styles[state.size], state.disabled && styles.disabled, state.root.className);
|
|
80
|
+
return state;
|
|
81
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/TagPickerInput/useTagPickerInputStyles.styles.ts"],"sourcesContent":["import { makeResetStyles, makeStyles, mergeClasses } from '@griffel/react';\nimport { typographyStyles, tokens } from '@fluentui/react-theme';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { TagPickerInputSlots, TagPickerInputState } from './TagPickerInput.types';\nimport { tagPickerInputTokens } from '../../utils/tokens';\n\nexport const tagPickerInputClassNames: SlotClassNames<TagPickerInputSlots> = {\n root: 'fui-TagPickerInput',\n};\n\nconst useBaseStyle = makeResetStyles({\n backgroundColor: tokens.colorTransparentBackground,\n color: tokens.colorNeutralForeground1,\n fontFamily: tokens.fontFamilyBase,\n boxSizing: 'border-box',\n\n '&:focus': {\n outlineStyle: 'none',\n },\n '&::placeholder': {\n color: tokens.colorNeutralForeground4,\n opacity: 1,\n },\n '&::after': {\n visibility: 'hidden',\n whiteSpace: 'pre-wrap',\n },\n border: 'none',\n minWidth: '24px',\n maxWidth: '100%',\n // by default width is 0,\n // it will be calculated based on the requirement of stretching the component to 100% width\n // see setTagPickerInputStretchStyle method for more details\n width: tagPickerInputTokens.width,\n flexGrow: 1,\n});\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n // size variants\n medium: {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalSNudge} 0 ${tokens.spacingVerticalSNudge} 0`,\n },\n large: {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalMNudge} 0 ${tokens.spacingVerticalMNudge} 0`,\n },\n 'extra-large': {\n ...typographyStyles.body1,\n padding: `${tokens.spacingVerticalM} 0 ${tokens.spacingVerticalM} 0`,\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorTransparentBackground,\n cursor: 'not-allowed',\n '::placeholder': {\n color: tokens.colorNeutralForegroundDisabled,\n },\n },\n});\n\n/**\n * Apply styling to the TagPickerInput slots based on the state\n */\nexport const useTagPickerInputStyles_unstable = (state: TagPickerInputState): TagPickerInputState => {\n 'use no memo';\n\n const baseStyle = useBaseStyle();\n const styles = useStyles();\n state.root.className = mergeClasses(\n tagPickerInputClassNames.root,\n baseStyle,\n styles[state.size],\n state.disabled && styles.disabled,\n state.root.className,\n );\n return state;\n};\n"],"names":["tagPickerInputClassNames","useTagPickerInputStyles_unstable","root","useBaseStyle","makeResetStyles","backgroundColor","tokens","colorTransparentBackground","color","colorNeutralForeground1","fontFamily","fontFamilyBase","boxSizing","outlineStyle","colorNeutralForeground4","opacity","visibility","whiteSpace","border","minWidth","maxWidth","width","tagPickerInputTokens","flexGrow","useStyles","makeStyles","medium","typographyStyles","body1","padding","spacingVerticalSNudge","large","spacingVerticalMNudge","spacingVerticalM","disabled","colorNeutralForegroundDisabled","cursor","state","baseStyle","styles","className","mergeClasses","size"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";;;;;;;;;;;IAMaA,wBAAAA;eAAAA;;IA6DAC,gCAAAA;eAAAA;;;uBAnE6C;4BACjB;wBAGJ;AAE9B,MAAMD,2BAAgE;IAC3EE,MAAM;AACR;AAEA,MAAMC,eAAeC,IAAAA,sBAAAA,EAAgB;IACnCC,iBAAiBC,kBAAAA,CAAOC,0BAA0B;IAClDC,OAAOF,kBAAAA,CAAOG,uBAAuB;IACrCC,YAAYJ,kBAAAA,CAAOK,cAAc;IACjCC,WAAW;IAEX,WAAW;QACTC,cAAc;IAChB;IACA,kBAAkB;QAChBL,OAAOF,kBAAAA,CAAOQ,uBAAuB;QACrCC,SA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