@fluentui/react-toolbar 9.74.7-experimental.cli-api.20261006-ccaa611d58.0 → 9.75.0-experimental.css-modules.20261031-810ab07afb.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 +54 -14
- package/README.md +12 -0
- package/lib/components/Toolbar/Toolbar.js.map +1 -1
- package/lib/components/Toolbar/Toolbar.module.css +24 -0
- package/lib/components/Toolbar/Toolbar.types.js.map +1 -1
- package/lib/components/Toolbar/ToolbarContext.js.map +1 -1
- package/lib/components/Toolbar/index.js.map +1 -1
- package/lib/components/Toolbar/renderToolbar.js +2 -2
- package/lib/components/Toolbar/renderToolbar.js.map +1 -1
- package/lib/components/Toolbar/useToolbar.js.map +1 -1
- package/lib/components/Toolbar/useToolbarContextValues.js.map +1 -1
- package/lib/components/Toolbar/useToolbarStyles.styles.css.js +9 -0
- package/lib/components/Toolbar/useToolbarStyles.styles.css.js.map +1 -0
- package/lib/components/Toolbar/useToolbarStyles.styles.raw.css.js +9 -0
- package/lib/components/Toolbar/useToolbarStyles.styles.raw.css.js.map +1 -0
- package/lib/components/Toolbar/useToolbarStyles.styles.raw.js.map +1 -1
- package/lib/components/ToolbarButton/ToolbarButton.js.map +1 -1
- package/lib/components/ToolbarButton/ToolbarButton.module.css +10 -0
- package/lib/components/ToolbarButton/ToolbarButton.types.js.map +1 -1
- package/lib/components/ToolbarButton/index.js.map +1 -1
- package/lib/components/ToolbarButton/useToolbarButton.js.map +1 -1
- package/lib/components/ToolbarButton/useToolbarButtonStyles.styles.css.js +13 -0
- package/lib/components/ToolbarButton/useToolbarButtonStyles.styles.css.js.map +1 -0
- package/lib/components/ToolbarButton/useToolbarButtonStyles.styles.raw.css.js +13 -0
- package/lib/components/ToolbarButton/useToolbarButtonStyles.styles.raw.css.js.map +1 -0
- package/lib/components/ToolbarButton/useToolbarButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/ToolbarDivider/ToolbarDivider.js.map +1 -1
- package/lib/components/ToolbarDivider/ToolbarDivider.module.css +12 -0
- package/lib/components/ToolbarDivider/ToolbarDivider.types.js.map +1 -1
- package/lib/components/ToolbarDivider/index.js.map +1 -1
- package/lib/components/ToolbarDivider/useToolbarDivider.js.map +1 -1
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.styles.css.js +10 -0
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.styles.css.js.map +1 -0
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.styles.raw.css.js +10 -0
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.styles.raw.css.js.map +1 -0
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.styles.raw.js.map +1 -1
- package/lib/components/ToolbarGroup/ToolbarGroup.js.map +1 -1
- package/lib/components/ToolbarGroup/ToolbarGroup.module.css +11 -0
- package/lib/components/ToolbarGroup/ToolbarGroup.types.js.map +1 -1
- package/lib/components/ToolbarGroup/index.js.map +1 -1
- package/lib/components/ToolbarGroup/renderToolbarGroup.js +2 -2
- package/lib/components/ToolbarGroup/renderToolbarGroup.js.map +1 -1
- package/lib/components/ToolbarGroup/useToolbarGroup.js.map +1 -1
- package/lib/components/ToolbarGroup/useToolbarGroupStyles.styles.css.js +9 -0
- package/lib/components/ToolbarGroup/useToolbarGroupStyles.styles.css.js.map +1 -0
- package/lib/components/ToolbarGroup/useToolbarGroupStyles.styles.raw.css.js +9 -0
- package/lib/components/ToolbarGroup/useToolbarGroupStyles.styles.raw.css.js.map +1 -0
- package/lib/components/ToolbarGroup/useToolbarGroupStyles.styles.raw.js.map +1 -1
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.js.map +1 -1
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.module.css +10 -0
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.types.js.map +1 -1
- package/lib/components/ToolbarRadioButton/index.js.map +1 -1
- package/lib/components/ToolbarRadioButton/useToolbarRadioButton.js.map +1 -1
- package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.css.js +14 -0
- package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.css.js.map +1 -0
- package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.raw.css.js +14 -0
- package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.raw.css.js.map +1 -0
- package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.raw.js.map +1 -1
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.js.map +1 -1
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.types.js.map +1 -1
- package/lib/components/ToolbarRadioGroup/index.js.map +1 -1
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.js.map +1 -1
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.module.css +10 -0
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.types.js.map +1 -1
- package/lib/components/ToolbarToggleButton/index.js.map +1 -1
- package/lib/components/ToolbarToggleButton/useToolbarToggleButton.js.map +1 -1
- package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.css.js +14 -0
- package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.css.js.map +1 -0
- package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.raw.css.js +14 -0
- package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.raw.css.js.map +1 -0
- package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.raw.js.map +1 -1
- package/lib-commonjs/Toolbar.cjs +9 -9
- package/lib-commonjs/Toolbar.cjs.map +1 -1
- package/lib-commonjs/ToolbarButton.cjs +5 -5
- package/lib-commonjs/ToolbarDivider.cjs +5 -5
- package/lib-commonjs/ToolbarGroup.cjs +6 -6
- package/lib-commonjs/ToolbarRadioButton.cjs +5 -5
- package/lib-commonjs/ToolbarToggleButton.cjs +5 -5
- package/lib-commonjs/components/Toolbar/Toolbar.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/Toolbar.module.css +24 -0
- package/lib-commonjs/components/Toolbar/Toolbar.types.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/ToolbarContext.cjs +3 -3
- package/lib-commonjs/components/Toolbar/ToolbarContext.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/index.cjs +9 -9
- package/lib-commonjs/components/Toolbar/index.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/renderToolbar.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbar.cjs +4 -4
- package/lib-commonjs/components/Toolbar/useToolbar.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbarContextValues.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.cjs +3 -3
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.module.css +10 -0
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.types.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarButton/index.cjs +5 -5
- package/lib-commonjs/components/ToolbarButton/index.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarButton/useToolbarButton.cjs +3 -3
- package/lib-commonjs/components/ToolbarButton/useToolbarButton.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.styles.css.cjs +24 -0
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.styles.raw.css.cjs +24 -0
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.module.css +12 -0
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.types.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/index.cjs +5 -5
- package/lib-commonjs/components/ToolbarDivider/index.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/useToolbarDivider.cjs +3 -3
- package/lib-commonjs/components/ToolbarDivider/useToolbarDivider.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.styles.css.cjs +21 -0
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.styles.raw.css.cjs +21 -0
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.module.css +11 -0
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.types.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/index.cjs +7 -7
- package/lib-commonjs/components/ToolbarGroup/index.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/renderToolbarGroup.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroup.cjs +3 -3
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroup.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.css.cjs +28 -0
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.raw.css.cjs +28 -0
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.module.css +10 -0
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.types.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/index.cjs +5 -5
- package/lib-commonjs/components/ToolbarRadioButton/index.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButton.cjs +3 -3
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButton.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.css.cjs +25 -0
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.raw.css.cjs +25 -0
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarRadioGroup/ToolbarRadioGroup.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarRadioGroup/ToolbarRadioGroup.types.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarRadioGroup/index.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.module.css +10 -0
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.types.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/index.cjs +5 -5
- package/lib-commonjs/components/ToolbarToggleButton/index.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButton.cjs +3 -3
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButton.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.css.cjs +25 -0
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.css.cjs.map +1 -0
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.raw.css.cjs +25 -0
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.raw.css.cjs.map +1 -0
- package/lib-commonjs/index.cjs +31 -31
- package/lib-commonjs/index.cjs.map +1 -1
- package/package.json +17 -17
- package/dist/metadata/api/api-root.json +0 -1
- package/dist/metadata/index.json +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarGroup/useToolbarGroup.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\n\nimport type { ToolbarGroupProps, ToolbarGroupState } from './ToolbarGroup.types';\nimport { getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';\n\n/**\n * Given user props, defines default props for the Group\n * @param props - User provided props to the Group component.\n * @param ref - User provided ref to be passed to the Group component.\n */\nexport const useToolbarGroup_unstable = (\n props: ToolbarGroupProps,\n ref: React.Ref<HTMLDivElement>,\n): ToolbarGroupState => {\n return useToolbarGroupBase_unstable(props, ref);\n};\n\n/**\n * Base hook that builds Toolbar Group state for behavior and structure only.\n * It does not provide any design-related defaults.\n *\n * @internal\n * @param props - User provided props to the Group component.\n * @param ref - User provided ref to be passed to the Group component.\n */\nexport const useToolbarGroupBase_unstable = (\n props: ToolbarGroupProps,\n ref: React.Ref<HTMLDivElement>,\n): ToolbarGroupState => {\n const vertical = useToolbarContext_unstable(ctx => ctx.vertical);\n\n return {\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps<React.HTMLAttributes<HTMLDivElement>>('div', {\n ref,\n role: 'presentation',\n ...props,\n }),\n { elementType: 'div' },\n ),\n vertical,\n };\n};\n"],"names":["getIntrinsicElementProps","slot","useToolbarContext_unstable","useToolbarGroup_unstable","props","ref","useToolbarGroupBase_unstable","vertical","ctx","components","root","always","role","elementType"],"mappings":"AAAA;AAKA,SAASA,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAC3E,SAASC,0BAA0B,QAAQ,+BAA4B;AAEvE;;;;CAIC,GACD,OAAO,MAAMC,2BAA2B,CACtCC,OACAC;IAEA,OAAOC,6BAA6BF,OAAOC;AAC7C,EAAE;AAEF;;;;;;;CAOC,GACD,OAAO,MAAMC,+BAA+B,CAC1CF,OACAC;IAEA,MAAME,WAAWL,2BAA2BM,CAAAA,MAAOA,IAAID,QAAQ;IAE/D,OAAO;QACLE,YAAY;YACVC,MAAM;QACR;QACAA,MAAMT,KAAKU,MAAM,CACfX,yBAA+D,OAAO;YACpEK;YACAO,MAAM;YACN,GAAGR,KAAK;QACV,IACA;YAAES,aAAa;QAAM;QAEvBN;IACF;AACF,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./ToolbarGroup.module.css";
|
|
3
|
+
export const toolbarGroupClassNames = {
|
|
4
|
+
root: 'fui-ToolbarGroup'
|
|
5
|
+
};
|
|
6
|
+
export const useToolbarGroupStyles_unstable = (state)=>{
|
|
7
|
+
state.root.className = clsx(toolbarGroupClassNames.root, styles.root, state.vertical && styles.vertical, state.root.className);
|
|
8
|
+
return state;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarGroup/useToolbarGroupStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ToolbarGroupState, ToolbarGroupSlots } from './ToolbarGroup.types';\nimport styles from './ToolbarGroup.module.css';\n\nexport const toolbarGroupClassNames: SlotClassNames<ToolbarGroupSlots> = {\n root: 'fui-ToolbarGroup',\n};\n\nexport const useToolbarGroupStyles_unstable = (state: ToolbarGroupState): ToolbarGroupState => {\n state.root.className = clsx(\n toolbarGroupClassNames.root,\n styles.root,\n state.vertical && styles.vertical,\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","toolbarGroupClassNames","root","useToolbarGroupStyles_unstable","state","className","vertical"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,4BAA4B;AAE/C,OAAO,MAAMC,yBAA4D;IACvEC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,iCAAiC,CAACC;IAC7CA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,uBAAuBC,IAAI,EAC3BF,OAAOE,IAAI,EACXE,MAAME,QAAQ,IAAIN,OAAOM,QAAQ,EACjCF,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./ToolbarGroup.module.css";
|
|
3
|
+
export const toolbarGroupClassNames = {
|
|
4
|
+
root: 'fui-ToolbarGroup'
|
|
5
|
+
};
|
|
6
|
+
export const useToolbarGroupStyles_unstable = (state)=>{
|
|
7
|
+
state.root.className = clsx(toolbarGroupClassNames.root, styles.root, state.vertical && styles.vertical, state.root.className);
|
|
8
|
+
return state;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarGroup/useToolbarGroupStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ToolbarGroupState, ToolbarGroupSlots } from './ToolbarGroup.types';\nimport styles from './ToolbarGroup.module.css';\n\nexport const toolbarGroupClassNames: SlotClassNames<ToolbarGroupSlots> = {\n root: 'fui-ToolbarGroup',\n};\n\nexport const useToolbarGroupStyles_unstable = (state: ToolbarGroupState): ToolbarGroupState => {\n state.root.className = clsx(\n toolbarGroupClassNames.root,\n styles.root,\n state.vertical && styles.vertical,\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","toolbarGroupClassNames","root","useToolbarGroupStyles_unstable","state","className","vertical"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,4BAA4B;AAE/C,OAAO,MAAMC,yBAA4D;IACvEC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,iCAAiC,CAACC;IAC7CA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,uBAAuBC,IAAI,EAC3BF,OAAOE,IAAI,EACXE,MAAME,QAAQ,IAAIN,OAAOM,QAAQ,EACjCF,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarGroup/useToolbarGroupStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\n\nimport type { ToolbarGroupSlots, ToolbarGroupState } from './ToolbarGroup.types';\n\nexport const toolbarGroupClassNames: SlotClassNames<ToolbarGroupSlots> = {\n root: 'fui-ToolbarGroup',\n};\n\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n },\n vertical: {\n flexDirection: 'column',\n width: 'fit-content',\n },\n});\n\n/**\n * Apply styling to the Toolbar slots based on the state\n */\nexport const useToolbarGroupStyles_unstable = (state: ToolbarGroupState): ToolbarGroupState => {\n const { vertical } = state;\n const styles = useStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n toolbarGroupClassNames.root,\n styles.root,\n vertical && styles.vertical,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","toolbarGroupClassNames","root","useStyles","display","alignItems","vertical","flexDirection","width","useToolbarGroupStyles_unstable","state","styles","className"],"mappings":"AAAA;AAGA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAI1D,OAAO,MAAMC,yBAA4D;IACvEC,MAAM;AACR,EAAE;AAEF,MAAMC,YAAYJ,WAAW;IAC3BG,MAAM;QACJE,SAAS;QACTC,YAAY;IACd;IACAC,UAAU;QACRC,eAAe;QACfC,OAAO;IACT;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,iCAAiC,CAACC;IAC7C,MAAM,EAAEJ,QAAQ,EAAE,GAAGI;IACrB,MAAMC,SAASR;IAEf,oDAAoD;IACpDO,MAAMR,IAAI,CAACU,SAAS,GAAGZ,aACrBC,uBAAuBC,IAAI,EAC3BS,OAAOT,IAAI,EACXI,YAAYK,OAAOL,QAAQ,EAC3BI,MAAMR,IAAI,CAACU,SAAS;IAGtB,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioButton/ToolbarRadioButton.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ToolbarRadioButtonProps } from './ToolbarRadioButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderToggleButton_unstable } from '@fluentui/react-button';\nimport { useToolbarRadioButton_unstable } from './useToolbarRadioButton';\nimport { useToolbarRadioButtonStyles_unstable } from './useToolbarRadioButtonStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ToolbarRadioButton component\n */\nexport const ToolbarRadioButton: ForwardRefComponent<ToolbarRadioButtonProps> = React.forwardRef((props, ref) => {\n const state = useToolbarRadioButton_unstable(props, ref);\n\n useToolbarRadioButtonStyles_unstable(state);\n\n useCustomStyleHook_unstable('useToolbarRadioButtonStyles_unstable')(state);\n\n return renderToggleButton_unstable(state);\n}) as ForwardRefComponent<ToolbarRadioButtonProps>;\n\nToolbarRadioButton.displayName = 'ToolbarRadioButton';\n"],"names":["React","renderToggleButton_unstable","useToolbarRadioButton_unstable","useToolbarRadioButtonStyles_unstable","useCustomStyleHook_unstable","ToolbarRadioButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,2BAA2B,QAAQ,yBAAyB;AACrE,SAASC,8BAA8B,QAAQ,6BAA0B;AACzE,SAASC,oCAAoC,QAAQ,0CAAuC;AAC5F,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,mCAAmEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACvG,MAAMC,QAAQP,+BAA+BK,OAAOC;IAEpDL,qCAAqCM;IAErCL,4BAA4B,wCAAwCK;IAEpE,OAAOR,4BAA4BQ;AACrC,GAAmD;AAEnDJ,mBAAmBK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioButton/ToolbarRadioButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, DistributiveOmit } from '@fluentui/react-utilities';\nimport type { ToggleButtonProps, ButtonSlots, ToggleButtonState } from '@fluentui/react-button';\n\n/**\n * ToolbarRadioButton Props\n */\nexport type ToolbarRadioButtonProps = ComponentProps<ButtonSlots> &\n Partial<Pick<ToggleButtonProps, 'disabled' | 'disabledFocusable' | 'size'>> & {\n appearance?: 'primary' | 'subtle' | 'transparent';\n name: string;\n value: string;\n };\n\nexport type ToolbarRadioButtonBaseProps = DistributiveOmit<ToolbarRadioButtonProps, 'appearance'>;\n\n/**\n * State used in rendering ToolbarRadioButton\n */\nexport type ToolbarRadioButtonState = ComponentState<Partial<ButtonSlots>> &\n ToggleButtonState &\n Required<Pick<ToggleButtonProps, 'checked'>> &\n Pick<ToolbarRadioButtonProps, 'name' | 'value'>;\n\nexport type ToolbarRadioButtonBaseState = DistributiveOmit<ToolbarRadioButtonState, 'appearance' | 'size' | 'shape'>;\n"],"names":[],"mappings":"AAuBA,WAAqH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioButton/index.ts"],"sourcesContent":["export { ToolbarRadioButton } from './ToolbarRadioButton';\nexport type {\n ToolbarRadioButtonBaseProps,\n ToolbarRadioButtonProps,\n ToolbarRadioButtonBaseState,\n ToolbarRadioButtonState,\n} from './ToolbarRadioButton.types';\nexport { useToolbarRadioButton_unstable, useToolbarRadioButtonBase_unstable } from './useToolbarRadioButton';\nexport { useToolbarRadioButtonStyles_unstable } from './useToolbarRadioButtonStyles.styles';\n"],"names":["ToolbarRadioButton","useToolbarRadioButton_unstable","useToolbarRadioButtonBase_unstable","useToolbarRadioButtonStyles_unstable"],"mappings":"AAAA,SAASA,kBAAkB,QAAQ,0BAAuB;AAO1D,SAASC,8BAA8B,EAAEC,kCAAkC,QAAQ,6BAA0B;AAC7G,SAASC,oCAAoC,QAAQ,0CAAuC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioButton/useToolbarRadioButton.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useEventCallback } from '@fluentui/react-utilities';\nimport { useToggleButtonBase_unstable } from '@fluentui/react-button';\nimport { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';\nimport type {\n ToolbarRadioButtonProps,\n ToolbarRadioButtonState,\n ToolbarRadioButtonBaseProps,\n ToolbarRadioButtonBaseState,\n} from './ToolbarRadioButton.types';\n\n/**\n * Given user props, defines default props for the RadioButton, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the RadioButton component.\n * @param ref - User provided ref to be passed to the RadioButton component.\n */\nexport const useToolbarRadioButton_unstable = (\n props: ToolbarRadioButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToolbarRadioButtonState => {\n const contextSize = useToolbarContext_unstable(ctx => ctx.size);\n const { appearance = 'subtle', size = contextSize, ...baseProps } = props;\n const state = useToolbarRadioButtonBase_unstable(baseProps, ref);\n\n return {\n ...state,\n appearance,\n size,\n shape: 'rounded',\n };\n};\n\n/**\n * Base hook that builds Toolbar RadioButton state for behavior and structure only.\n * It does not provide any design-related defaults.\n *\n * @internal\n * @param props - User provided props to the RadioButton component.\n * @param ref - User provided ref to be passed to the RadioButton component.\n */\nexport const useToolbarRadioButtonBase_unstable = (\n props: ToolbarRadioButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToolbarRadioButtonBaseState => {\n const handleRadio = useToolbarContext_unstable(ctx => ctx.handleRadio);\n const checked = useToolbarContext_unstable(ctx => !!ctx.checkedValues[props.name]?.includes(props.value));\n\n const { onClick: onClickOriginal } = props;\n const toggleButtonState = useToggleButtonBase_unstable(\n { checked, role: 'radio', 'aria-checked': checked, ...props },\n ref,\n );\n const state: ToolbarRadioButtonBaseState = {\n ...toggleButtonState,\n name: props.name,\n value: props.value,\n };\n\n const handleOnClick = useEventCallback(\n (e: React.MouseEvent<HTMLButtonElement, MouseEvent> & React.MouseEvent<HTMLAnchorElement, MouseEvent>) => {\n handleRadio?.(e, state.name, state.value, state.checked);\n onClickOriginal?.(e);\n },\n );\n // eslint-disable-next-line react-hooks/immutability\n state.root['aria-pressed'] = undefined;\n // eslint-disable-next-line react-hooks/immutability\n state.root.onClick = handleOnClick;\n\n return state;\n};\n"],"names":["useEventCallback","useToggleButtonBase_unstable","useToolbarContext_unstable","useToolbarRadioButton_unstable","props","ref","contextSize","ctx","size","appearance","baseProps","state","useToolbarRadioButtonBase_unstable","shape","handleRadio","checked","checkedValues","name","includes","value","onClick","onClickOriginal","toggleButtonState","role","handleOnClick","e","root","undefined"],"mappings":"AAAA;AAGA,SAASA,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,4BAA4B,QAAQ,yBAAyB;AACtE,SAASC,0BAA0B,QAAQ,+BAA4B;AAQvE;;;;;CAKC,GACD,OAAO,MAAMC,iCAAiC,CAC5CC,OACAC;IAEA,MAAMC,cAAcJ,2BAA2BK,CAAAA,MAAOA,IAAIC,IAAI;IAC9D,MAAM,EAAEC,aAAa,QAAQ,EAAED,OAAOF,WAAW,EAAE,GAAGI,WAAW,GAAGN;IACpE,MAAMO,QAAQC,mCAAmCF,WAAWL;IAE5D,OAAO;QACL,GAAGM,KAAK;QACRF;QACAD;QACAK,OAAO;IACT;AACF,EAAE;AAEF;;;;;;;CAOC,GACD,OAAO,MAAMD,qCAAqC,CAChDR,OACAC;IAEA,MAAMS,cAAcZ,2BAA2BK,CAAAA,MAAOA,IAAIO,WAAW;IACrE,MAAMC,UAAUb,2BAA2BK,CAAAA;YAASA;eAAF,CAAC,GAACA,gCAAAA,IAAIS,aAAa,CAACZ,MAAMa,IAAI,CAAC,cAA7BV,oDAAAA,8BAA+BW,QAAQ,CAACd,MAAMe,KAAK;;IAEvG,MAAM,EAAEC,SAASC,eAAe,EAAE,GAAGjB;IACrC,MAAMkB,oBAAoBrB,6BACxB;QAAEc;QAASQ,MAAM;QAAS,gBAAgBR;QAAS,GAAGX,KAAK;IAAC,GAC5DC;IAEF,MAAMM,QAAqC;QACzC,GAAGW,iBAAiB;QACpBL,MAAMb,MAAMa,IAAI;QAChBE,OAAOf,MAAMe,KAAK;IACpB;IAEA,MAAMK,gBAAgBxB,iBACpB,CAACyB;QACCX,wBAAAA,kCAAAA,YAAcW,GAAGd,MAAMM,IAAI,EAAEN,MAAMQ,KAAK,EAAER,MAAMI,OAAO;QACvDM,4BAAAA,sCAAAA,gBAAkBI;IACpB;IAEF,oDAAoD;IACpDd,MAAMe,IAAI,CAAC,eAAe,GAAGC;IAC7B,oDAAoD;IACpDhB,MAAMe,IAAI,CAACN,OAAO,GAAGI;IAErB,OAAOb;AACT,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useToggleButtonStyles_unstable } from "@fluentui/react-button";
|
|
4
|
+
import styles from "./ToolbarRadioButton.module.css";
|
|
5
|
+
export const useToolbarRadioButtonStyles_unstable = (state)=>{
|
|
6
|
+
useToggleButtonStyles_unstable(state);
|
|
7
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
8
|
+
state.root.className = clsx(state.checked && styles.checked, state.root.className);
|
|
9
|
+
if (state.icon) {
|
|
10
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
11
|
+
state.icon.className = clsx(state.checked && styles.checkedIcon, state.icon.className);
|
|
12
|
+
}
|
|
13
|
+
return state;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { useToggleButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarRadioButtonState } from './ToolbarRadioButton.types';\nimport styles from './ToolbarRadioButton.module.css';\n\nexport const useToolbarRadioButtonStyles_unstable = (state: ToolbarRadioButtonState): ToolbarRadioButtonState => {\n useToggleButtonStyles_unstable(state);\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(state.checked && styles.checked, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(state.checked && styles.checkedIcon, state.icon.className);\n }\n\n return state;\n};\n"],"names":["clsx","useToggleButtonStyles_unstable","styles","useToolbarRadioButtonStyles_unstable","state","root","className","checked","icon","checkedIcon"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,8BAA8B,QAAQ,yBAAyB;AAExE,OAAOC,YAAY,kCAAkC;AAErD,OAAO,MAAMC,uCAAuC,CAACC;IACnDH,+BAA+BG;IAC/B,oDAAoD;IACpDA,MAAMC,IAAI,CAACC,SAAS,GAAGN,KAAKI,MAAMG,OAAO,IAAIL,OAAOK,OAAO,EAAEH,MAAMC,IAAI,CAACC,SAAS;IAEjF,IAAIF,MAAMI,IAAI,EAAE;QACd,oDAAoD;QACpDJ,MAAMI,IAAI,CAACF,SAAS,GAAGN,KAAKI,MAAMG,OAAO,IAAIL,OAAOO,WAAW,EAAEL,MAAMI,IAAI,CAACF,SAAS;IACvF;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useToggleButtonStyles_unstable } from "@fluentui/react-button";
|
|
4
|
+
import styles from "./ToolbarRadioButton.module.css";
|
|
5
|
+
export const useToolbarRadioButtonStyles_unstable = (state)=>{
|
|
6
|
+
useToggleButtonStyles_unstable(state);
|
|
7
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
8
|
+
state.root.className = clsx(state.checked && styles.checked, state.root.className);
|
|
9
|
+
if (state.icon) {
|
|
10
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
11
|
+
state.icon.className = clsx(state.checked && styles.checkedIcon, state.icon.className);
|
|
12
|
+
}
|
|
13
|
+
return state;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { useToggleButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarRadioButtonState } from './ToolbarRadioButton.types';\nimport styles from './ToolbarRadioButton.module.css';\n\nexport const useToolbarRadioButtonStyles_unstable = (state: ToolbarRadioButtonState): ToolbarRadioButtonState => {\n useToggleButtonStyles_unstable(state);\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(state.checked && styles.checked, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(state.checked && styles.checkedIcon, state.icon.className);\n }\n\n return state;\n};\n"],"names":["clsx","useToggleButtonStyles_unstable","styles","useToolbarRadioButtonStyles_unstable","state","root","className","checked","icon","checkedIcon"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,8BAA8B,QAAQ,yBAAyB;AAExE,OAAOC,YAAY,kCAAkC;AAErD,OAAO,MAAMC,uCAAuC,CAACC;IACnDH,+BAA+BG;IAC/B,oDAAoD;IACpDA,MAAMC,IAAI,CAACC,SAAS,GAAGN,KAAKI,MAAMG,OAAO,IAAIL,OAAOK,OAAO,EAAEH,MAAMC,IAAI,CAACC,SAAS;IAEjF,IAAIF,MAAMI,IAAI,EAAE;QACd,oDAAoD;QACpDJ,MAAMI,IAAI,CAACF,SAAS,GAAGN,KAAKI,MAAMG,OAAO,IAAIL,OAAOO,WAAW,EAAEL,MAAMI,IAAI,CAACF,SAAS;IACvF;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useToggleButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarRadioButtonState } from './ToolbarRadioButton.types';\n\nconst useBaseStyles = makeStyles({\n /* use subtle ToggleButton selected styles for Toolbar Radio selected state */\n selected: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n color: tokens.colorNeutralForeground2Selected,\n },\n\n iconSelected: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n});\n\n/**\n * Apply styling to the ToolbarRadioButton slots based on the state\n */\nexport const useToolbarRadioButtonStyles_unstable = (state: ToolbarRadioButtonState): ToolbarRadioButtonState => {\n const toggleButtonStyles = useBaseStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(state.checked && toggleButtonStyles.selected, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(state.checked && toggleButtonStyles.iconSelected, state.icon.className);\n }\n\n useToggleButtonStyles_unstable(state);\n\n return state;\n};\n"],"names":["tokens","makeStyles","mergeClasses","useToggleButtonStyles_unstable","useBaseStyles","selected","backgroundColor","colorSubtleBackgroundSelected","color","colorNeutralForeground2Selected","iconSelected","colorNeutralForeground2BrandSelected","useToolbarRadioButtonStyles_unstable","state","toggleButtonStyles","root","className","checked","icon"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,8BAA8B,QAAQ,yBAAyB;AAGxE,MAAMC,gBAAgBH,WAAW;IAC/B,4EAA4E,GAC5EI,UAAU;QACRC,iBAAiBN,OAAOO,6BAA6B;QACrDC,OAAOR,OAAOS,+BAA+B;IAC/C;IAEAC,cAAc;QACZF,OAAOR,OAAOW,oCAAoC;IACpD;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,uCAAuC,CAACC;IACnD,MAAMC,qBAAqBV;IAE3B,oDAAoD;IACpDS,MAAME,IAAI,CAACC,SAAS,GAAGd,aAAaW,MAAMI,OAAO,IAAIH,mBAAmBT,QAAQ,EAAEQ,MAAME,IAAI,CAACC,SAAS;IAEtG,IAAIH,MAAMK,IAAI,EAAE;QACd,oDAAoD;QACpDL,MAAMK,IAAI,CAACF,SAAS,GAAGd,aAAaW,MAAMI,OAAO,IAAIH,mBAAmBJ,YAAY,EAAEG,MAAMK,IAAI,CAACF,SAAS;IAC5G;IAEAb,+BAA+BU;IAE/B,OAAOA;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioGroup/ToolbarRadioGroup.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ToolbarRadioGroupProps } from './ToolbarRadioGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport {\n renderToolbarGroup_unstable,\n useToolbarGroupStyles_unstable,\n useToolbarGroup_unstable,\n} from '../../ToolbarGroup';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ToolbarRadioGroup component is a Button to be used inside Toolbar\n * which will respect toolbar props such as `size`\n */\nexport const ToolbarRadioGroup: ForwardRefComponent<ToolbarRadioGroupProps> = React.forwardRef((props, ref) => {\n const state = useToolbarGroup_unstable({ role: 'radiogroup', ...props }, ref);\n\n useToolbarGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useToolbarGroupStyles_unstable')(state);\n\n return renderToolbarGroup_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ToolbarRadioGroupProps>;\n\nToolbarRadioGroup.displayName = 'ToolbarRadioGroup';\n"],"names":["React","renderToolbarGroup_unstable","useToolbarGroupStyles_unstable","useToolbarGroup_unstable","useCustomStyleHook_unstable","ToolbarRadioGroup","forwardRef","props","ref","state","role","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SACEC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,wBAAwB,QACnB,wBAAqB;AAC5B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,kCAAiEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACrG,MAAMC,QAAQN,yBAAyB;QAAEO,MAAM;QAAc,GAAGH,KAAK;IAAC,GAAGC;IAEzEN,+BAA+BO;IAE/BL,4BAA4B,kCAAkCK;IAE9D,OAAOR,4BAA4BQ;AACnC,0FAA0F;AAC5F,GAAkD;AAElDJ,kBAAkBM,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioGroup/ToolbarRadioGroup.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ToolbarRadioGroupSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * ToolbarButton Props\n */\nexport type ToolbarRadioGroupProps = ComponentProps<ToolbarRadioGroupSlots>;\n\n/**\n * State used in rendering ToolbarButton\n */\nexport type ToolbarRadioGroupState = ComponentState<ToolbarRadioGroupSlots>;\n"],"names":[],"mappings":"AAWA;;CAEC,GACD,WAA4E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarRadioGroup/index.ts"],"sourcesContent":["export { ToolbarRadioGroup } from './ToolbarRadioGroup';\nexport type { ToolbarRadioGroupProps, ToolbarRadioGroupSlots, ToolbarRadioGroupState } from './ToolbarRadioGroup.types';\n"],"names":["ToolbarRadioGroup"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,yBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarToggleButton/ToolbarToggleButton.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ToolbarToggleButtonProps } from './ToolbarToggleButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderToggleButton_unstable } from '@fluentui/react-button';\nimport { useToolbarToggleButton_unstable } from './useToolbarToggleButton';\nimport { useToolbarToggleButtonStyles_unstable } from './useToolbarToggleButtonStyles.styles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ToolbarToggleButton component\n */\nexport const ToolbarToggleButton: ForwardRefComponent<ToolbarToggleButtonProps> = React.forwardRef((props, ref) => {\n const state = useToolbarToggleButton_unstable(props, ref);\n\n useToolbarToggleButtonStyles_unstable(state);\n\n useCustomStyleHook_unstable('useToolbarToggleButtonStyles_unstable')(state);\n\n return renderToggleButton_unstable(state);\n}) as ForwardRefComponent<ToolbarToggleButtonProps>;\n\nToolbarToggleButton.displayName = 'ToolbarToggleButton';\n"],"names":["React","renderToggleButton_unstable","useToolbarToggleButton_unstable","useToolbarToggleButtonStyles_unstable","useCustomStyleHook_unstable","ToolbarToggleButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,2BAA2B,QAAQ,yBAAyB;AACrE,SAASC,+BAA+B,QAAQ,8BAA2B;AAC3E,SAASC,qCAAqC,QAAQ,2CAAwC;AAC9F,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,oCAAqEL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IACzG,MAAMC,QAAQP,gCAAgCK,OAAOC;IAErDL,sCAAsCM;IAEtCL,4BAA4B,yCAAyCK;IAErE,OAAOR,4BAA4BQ;AACrC,GAAoD;AAEpDJ,oBAAoBK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarToggleButton/ToolbarToggleButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, DistributiveOmit } from '@fluentui/react-utilities';\nimport type { ToggleButtonProps, ButtonSlots, ToggleButtonState } from '@fluentui/react-button';\n\n/**\n * ToolbarToggleButton Props\n */\nexport type ToolbarToggleButtonProps = ComponentProps<ButtonSlots> &\n Partial<Pick<ToggleButtonProps, 'disabled' | 'disabledFocusable' | 'size'>> & {\n appearance?: 'primary' | 'subtle' | 'transparent';\n name: string;\n value: string;\n };\n\nexport type ToolbarToggleButtonBaseProps = DistributiveOmit<ToolbarToggleButtonProps, 'appearance'>;\n\n/**\n * State used in rendering ToolbarToggleButton\n */\nexport type ToolbarToggleButtonState = ComponentState<Partial<ButtonSlots>> &\n ToggleButtonState &\n Required<Pick<ToggleButtonProps, 'checked'>> &\n Pick<ToolbarToggleButtonProps, 'name' | 'value'>;\n\nexport type ToolbarToggleButtonBaseState = DistributiveOmit<ToolbarToggleButtonState, 'appearance' | 'size' | 'shape'>;\n"],"names":[],"mappings":"AAuBA,WAAuH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarToggleButton/index.ts"],"sourcesContent":["export { ToolbarToggleButton } from './ToolbarToggleButton';\nexport type {\n ToolbarToggleButtonBaseState,\n ToolbarToggleButtonProps,\n ToolbarToggleButtonBaseProps,\n ToolbarToggleButtonState,\n} from './ToolbarToggleButton.types';\nexport { useToolbarToggleButton_unstable, useToolbarToggleButtonBase_unstable } from './useToolbarToggleButton';\nexport { useToolbarToggleButtonStyles_unstable } from './useToolbarToggleButtonStyles.styles';\n"],"names":["ToolbarToggleButton","useToolbarToggleButton_unstable","useToolbarToggleButtonBase_unstable","useToolbarToggleButtonStyles_unstable"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,2BAAwB;AAO5D,SAASC,+BAA+B,EAAEC,mCAAmC,QAAQ,8BAA2B;AAChH,SAASC,qCAAqC,QAAQ,2CAAwC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarToggleButton/useToolbarToggleButton.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useToggleButtonBase_unstable } from '@fluentui/react-button';\nimport { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';\nimport type {\n ToolbarToggleButtonProps,\n ToolbarToggleButtonState,\n ToolbarToggleButtonBaseProps,\n ToolbarToggleButtonBaseState,\n} from './ToolbarToggleButton.types';\n\n/**\n * Given user props, defines default props for the ToggleButton, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the ToggleButton component.\n * @param ref - User provided ref to be passed to the ToggleButton component.\n */\nexport const useToolbarToggleButton_unstable = (\n props: ToolbarToggleButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToolbarToggleButtonState => {\n const contextSize = useToolbarContext_unstable(ctx => ctx.size);\n const { appearance = 'subtle', size = contextSize ?? 'medium', ...baseProps } = props;\n const state = useToolbarToggleButtonBase_unstable(baseProps, ref);\n\n return {\n ...state,\n appearance,\n size,\n shape: 'rounded',\n };\n};\n\n/**\n * Base hook that builds Toolbar ToggleButton state for behavior and structure only.\n * It does not provide any design-related defaults.\n *\n * @internal\n * @param props - User provided props to the ToggleButton component.\n * @param ref - User provided ref to be passed to the ToggleButton component.\n */\nexport const useToolbarToggleButtonBase_unstable = (\n props: ToolbarToggleButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToolbarToggleButtonBaseState => {\n const handleToggleButton = useToolbarContext_unstable(ctx => ctx.handleToggleButton);\n const checked = useToolbarContext_unstable(ctx => !!ctx.checkedValues[props.name]?.includes(props.value));\n\n const { onClick: onClickOriginal } = props;\n const toggleButtonState = useToggleButtonBase_unstable({ checked, ...props }, ref);\n const state: ToolbarToggleButtonBaseState = {\n ...toggleButtonState,\n name: props.name,\n value: props.value,\n };\n\n const handleOnClick = (\n e: React.MouseEvent<HTMLButtonElement, MouseEvent> & React.MouseEvent<HTMLAnchorElement, MouseEvent>,\n ) => {\n if (state.disabled || state.disabledFocusable) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n\n handleToggleButton?.(e, state.name, state.value, state.checked);\n onClickOriginal?.(e);\n };\n\n state.root.onClick = handleOnClick;\n return state;\n};\n"],"names":["useToggleButtonBase_unstable","useToolbarContext_unstable","useToolbarToggleButton_unstable","props","ref","contextSize","ctx","size","appearance","baseProps","state","useToolbarToggleButtonBase_unstable","shape","handleToggleButton","checked","checkedValues","name","includes","value","onClick","onClickOriginal","toggleButtonState","handleOnClick","e","disabled","disabledFocusable","preventDefault","stopPropagation","root"],"mappings":"AAAA;AAGA,SAASA,4BAA4B,QAAQ,yBAAyB;AACtE,SAASC,0BAA0B,QAAQ,+BAA4B;AAQvE;;;;;CAKC,GACD,OAAO,MAAMC,kCAAkC,CAC7CC,OACAC;IAEA,MAAMC,cAAcJ,2BAA2BK,CAAAA,MAAOA,IAAIC,IAAI;IAC9D,MAAM,EAAEC,aAAa,QAAQ,EAAED,OAAOF,wBAAAA,yBAAAA,cAAe,QAAQ,EAAE,GAAGI,WAAW,GAAGN;IAChF,MAAMO,QAAQC,oCAAoCF,WAAWL;IAE7D,OAAO;QACL,GAAGM,KAAK;QACRF;QACAD;QACAK,OAAO;IACT;AACF,EAAE;AAEF;;;;;;;CAOC,GACD,OAAO,MAAMD,sCAAsC,CACjDR,OACAC;IAEA,MAAMS,qBAAqBZ,2BAA2BK,CAAAA,MAAOA,IAAIO,kBAAkB;IACnF,MAAMC,UAAUb,2BAA2BK,CAAAA;YAASA;eAAF,CAAC,GAACA,gCAAAA,IAAIS,aAAa,CAACZ,MAAMa,IAAI,CAAC,cAA7BV,oDAAAA,8BAA+BW,QAAQ,CAACd,MAAMe,KAAK;;IAEvG,MAAM,EAAEC,SAASC,eAAe,EAAE,GAAGjB;IACrC,MAAMkB,oBAAoBrB,6BAA6B;QAAEc;QAAS,GAAGX,KAAK;IAAC,GAAGC;IAC9E,MAAMM,QAAsC;QAC1C,GAAGW,iBAAiB;QACpBL,MAAMb,MAAMa,IAAI;QAChBE,OAAOf,MAAMe,KAAK;IACpB;IAEA,MAAMI,gBAAgB,CACpBC;QAEA,IAAIb,MAAMc,QAAQ,IAAId,MAAMe,iBAAiB,EAAE;YAC7CF,EAAEG,cAAc;YAChBH,EAAEI,eAAe;YACjB;QACF;QAEAd,+BAAAA,yCAAAA,mBAAqBU,GAAGb,MAAMM,IAAI,EAAEN,MAAMQ,KAAK,EAAER,MAAMI,OAAO;QAC9DM,4BAAAA,sCAAAA,gBAAkBG;IACpB;IAEAb,MAAMkB,IAAI,CAACT,OAAO,GAAGG;IACrB,OAAOZ;AACT,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useToggleButtonStyles_unstable } from "@fluentui/react-button";
|
|
4
|
+
import styles from "./ToolbarToggleButton.module.css";
|
|
5
|
+
export const useToolbarToggleButtonStyles_unstable = (state)=>{
|
|
6
|
+
useToggleButtonStyles_unstable(state);
|
|
7
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
8
|
+
state.root.className = clsx(state.checked && styles.checked, state.root.className);
|
|
9
|
+
if (state.icon) {
|
|
10
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
11
|
+
state.icon.className = clsx(state.checked && styles.checkedIcon, state.icon.className);
|
|
12
|
+
}
|
|
13
|
+
return state;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { useToggleButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarToggleButtonState } from './ToolbarToggleButton.types';\nimport styles from './ToolbarToggleButton.module.css';\n\nexport const useToolbarToggleButtonStyles_unstable = (state: ToolbarToggleButtonState): ToolbarToggleButtonState => {\n useToggleButtonStyles_unstable(state);\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(state.checked && styles.checked, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(state.checked && styles.checkedIcon, state.icon.className);\n }\n\n return state;\n};\n"],"names":["clsx","useToggleButtonStyles_unstable","styles","useToolbarToggleButtonStyles_unstable","state","root","className","checked","icon","checkedIcon"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,8BAA8B,QAAQ,yBAAyB;AAExE,OAAOC,YAAY,mCAAmC;AAEtD,OAAO,MAAMC,wCAAwC,CAACC;IACpDH,+BAA+BG;IAC/B,oDAAoD;IACpDA,MAAMC,IAAI,CAACC,SAAS,GAAGN,KAAKI,MAAMG,OAAO,IAAIL,OAAOK,OAAO,EAAEH,MAAMC,IAAI,CAACC,SAAS;IAEjF,IAAIF,MAAMI,IAAI,EAAE;QACd,oDAAoD;QACpDJ,MAAMI,IAAI,CAACF,SAAS,GAAGN,KAAKI,MAAMG,OAAO,IAAIL,OAAOO,WAAW,EAAEL,MAAMI,IAAI,CAACF,SAAS;IACvF;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useToggleButtonStyles_unstable } from "@fluentui/react-button";
|
|
4
|
+
import styles from "./ToolbarToggleButton.module.css";
|
|
5
|
+
export const useToolbarToggleButtonStyles_unstable = (state)=>{
|
|
6
|
+
useToggleButtonStyles_unstable(state);
|
|
7
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
8
|
+
state.root.className = clsx(state.checked && styles.checked, state.root.className);
|
|
9
|
+
if (state.icon) {
|
|
10
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
11
|
+
state.icon.className = clsx(state.checked && styles.checkedIcon, state.icon.className);
|
|
12
|
+
}
|
|
13
|
+
return state;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { useToggleButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarToggleButtonState } from './ToolbarToggleButton.types';\nimport styles from './ToolbarToggleButton.module.css';\n\nexport const useToolbarToggleButtonStyles_unstable = (state: ToolbarToggleButtonState): ToolbarToggleButtonState => {\n useToggleButtonStyles_unstable(state);\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(state.checked && styles.checked, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(state.checked && styles.checkedIcon, state.icon.className);\n }\n\n return state;\n};\n"],"names":["clsx","useToggleButtonStyles_unstable","styles","useToolbarToggleButtonStyles_unstable","state","root","className","checked","icon","checkedIcon"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,8BAA8B,QAAQ,yBAAyB;AAExE,OAAOC,YAAY,mCAAmC;AAEtD,OAAO,MAAMC,wCAAwC,CAACC;IACpDH,+BAA+BG;IAC/B,oDAAoD;IACpDA,MAAMC,IAAI,CAACC,SAAS,GAAGN,KAAKI,MAAMG,OAAO,IAAIL,OAAOK,OAAO,EAAEH,MAAMC,IAAI,CAACC,SAAS;IAEjF,IAAIF,MAAMI,IAAI,EAAE;QACd,oDAAoD;QACpDJ,MAAMI,IAAI,CAACF,SAAS,GAAGN,KAAKI,MAAMG,OAAO,IAAIL,OAAOO,WAAW,EAAEL,MAAMI,IAAI,CAACF,SAAS;IACvF;IAEA,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useToggleButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarToggleButtonState } from './ToolbarToggleButton.types';\n\nconst useBaseStyles = makeStyles({\n /* use subtle ToggleButton selected styles for Toolbar Radio selected state */\n selected: {\n backgroundColor: tokens.colorSubtleBackgroundSelected,\n color: tokens.colorNeutralForeground2Selected,\n },\n\n iconSelected: {\n color: tokens.colorNeutralForeground2BrandSelected,\n },\n});\n\n/**\n * Apply styling to the ToolbarToggleButton slots based on the state\n */\nexport const useToolbarToggleButtonStyles_unstable = (state: ToolbarToggleButtonState): ToolbarToggleButtonState => {\n const toggleButtonStyles = useBaseStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(state.checked && toggleButtonStyles.selected, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(state.checked && toggleButtonStyles.iconSelected, state.icon.className);\n }\n\n useToggleButtonStyles_unstable(state);\n\n return state;\n};\n"],"names":["tokens","makeStyles","mergeClasses","useToggleButtonStyles_unstable","useBaseStyles","selected","backgroundColor","colorSubtleBackgroundSelected","color","colorNeutralForeground2Selected","iconSelected","colorNeutralForeground2BrandSelected","useToolbarToggleButtonStyles_unstable","state","toggleButtonStyles","root","className","checked","icon"],"mappings":"AAAA;AAEA,SAASA,MAAM,QAAQ,wBAAwB;AAC/C,SAASC,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,8BAA8B,QAAQ,yBAAyB;AAGxE,MAAMC,gBAAgBH,WAAW;IAC/B,4EAA4E,GAC5EI,UAAU;QACRC,iBAAiBN,OAAOO,6BAA6B;QACrDC,OAAOR,OAAOS,+BAA+B;IAC/C;IAEAC,cAAc;QACZF,OAAOR,OAAOW,oCAAoC;IACpD;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,wCAAwC,CAACC;IACpD,MAAMC,qBAAqBV;IAE3B,oDAAoD;IACpDS,MAAME,IAAI,CAACC,SAAS,GAAGd,aAAaW,MAAMI,OAAO,IAAIH,mBAAmBT,QAAQ,EAAEQ,MAAME,IAAI,CAACC,SAAS;IAEtG,IAAIH,MAAMK,IAAI,EAAE;QACd,oDAAoD;QACpDL,MAAMK,IAAI,CAACF,SAAS,GAAGd,aAAaW,MAAMI,OAAO,IAAIH,mBAAmBJ,YAAY,EAAEG,MAAMK,IAAI,CAACF,SAAS;IAC5G;IAEAb,+BAA+BU;IAE/B,OAAOA;AACT,EAAE"}
|
package/lib-commonjs/Toolbar.cjs
CHANGED
|
@@ -5,32 +5,32 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
Toolbar
|
|
12
|
+
get Toolbar () {
|
|
13
13
|
return _index.Toolbar;
|
|
14
14
|
},
|
|
15
|
-
renderToolbar_unstable
|
|
15
|
+
get renderToolbar_unstable () {
|
|
16
16
|
return _index.renderToolbar_unstable;
|
|
17
17
|
},
|
|
18
|
-
toolbarClassNames
|
|
18
|
+
get toolbarClassNames () {
|
|
19
19
|
return _index.toolbarClassNames;
|
|
20
20
|
},
|
|
21
|
-
useToolbarBase_unstable
|
|
21
|
+
get useToolbarBase_unstable () {
|
|
22
22
|
return _index.useToolbarBase_unstable;
|
|
23
23
|
},
|
|
24
|
-
useToolbarContextValues_unstable
|
|
24
|
+
get useToolbarContextValues_unstable () {
|
|
25
25
|
return _index.useToolbarContextValues_unstable;
|
|
26
26
|
},
|
|
27
|
-
useToolbarContext_unstable
|
|
27
|
+
get useToolbarContext_unstable () {
|
|
28
28
|
return _index.useToolbarContext_unstable;
|
|
29
29
|
},
|
|
30
|
-
useToolbarStyles_unstable
|
|
30
|
+
get useToolbarStyles_unstable () {
|
|
31
31
|
return _index.useToolbarStyles_unstable;
|
|
32
32
|
},
|
|
33
|
-
useToolbar_unstable
|
|
33
|
+
get useToolbar_unstable () {
|
|
34
34
|
return _index.useToolbar_unstable;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Toolbar.ts"],"sourcesContent":["export type {\n ToggableHandler,\n ToolbarCheckedValueChangeData,\n ToolbarCheckedValueChangeEvent,\n ToolbarContextValue,\n ToolbarContextValues,\n ToolbarBaseProps,\n ToolbarProps,\n ToolbarSlots,\n ToolbarBaseState,\n ToolbarState,\n UninitializedToolbarState,\n} from './components/Toolbar/index';\nexport {\n Toolbar,\n renderToolbar_unstable,\n toolbarClassNames,\n useToolbarStyles_unstable,\n useToolbar_unstable,\n useToolbarBase_unstable,\n useToolbarContext_unstable,\n useToolbarContextValues_unstable,\n} from './components/Toolbar/index';\n"],"names":["Toolbar","renderToolbar_unstable","toolbarClassNames","useToolbarStyles_unstable","useToolbar_unstable","useToolbarBase_unstable","useToolbarContext_unstable","useToolbarContextValues_unstable"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/Toolbar.ts"],"sourcesContent":["export type {\n ToggableHandler,\n ToolbarCheckedValueChangeData,\n ToolbarCheckedValueChangeEvent,\n ToolbarContextValue,\n ToolbarContextValues,\n ToolbarBaseProps,\n ToolbarProps,\n ToolbarSlots,\n ToolbarBaseState,\n ToolbarState,\n UninitializedToolbarState,\n} from './components/Toolbar/index';\nexport {\n Toolbar,\n renderToolbar_unstable,\n toolbarClassNames,\n useToolbarStyles_unstable,\n useToolbar_unstable,\n useToolbarBase_unstable,\n useToolbarContext_unstable,\n useToolbarContextValues_unstable,\n} from './components/Toolbar/index';\n"],"names":["Toolbar","renderToolbar_unstable","toolbarClassNames","useToolbarStyles_unstable","useToolbar_unstable","useToolbarBase_unstable","useToolbarContext_unstable","useToolbarContextValues_unstable"],"mappings":";;;;;;;;;;;;eAcEA,cAAO;;;eACPC,6BAAsB;;;eACtBC,wBAAiB;;;eAGjBG,8BAAuB;;;eAEvBE,uCAAgC;;;eADhCD,iCAA0B;;;eAH1BH,gCAAyB;;;eACzBC,0BAAmB;;;uBAId,gCAA6B"}
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ToolbarButton
|
|
12
|
+
get ToolbarButton () {
|
|
13
13
|
return _index.ToolbarButton;
|
|
14
14
|
},
|
|
15
|
-
useToolbarButtonBase_unstable
|
|
15
|
+
get useToolbarButtonBase_unstable () {
|
|
16
16
|
return _index.useToolbarButtonBase_unstable;
|
|
17
17
|
},
|
|
18
|
-
useToolbarButtonStyles_unstable
|
|
18
|
+
get useToolbarButtonStyles_unstable () {
|
|
19
19
|
return _index.useToolbarButtonStyles_unstable;
|
|
20
20
|
},
|
|
21
|
-
useToolbarButton_unstable
|
|
21
|
+
get useToolbarButton_unstable () {
|
|
22
22
|
return _index.useToolbarButton_unstable;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ToolbarDivider
|
|
12
|
+
get ToolbarDivider () {
|
|
13
13
|
return _index.ToolbarDivider;
|
|
14
14
|
},
|
|
15
|
-
useToolbarDividerBase_unstable
|
|
15
|
+
get useToolbarDividerBase_unstable () {
|
|
16
16
|
return _index.useToolbarDividerBase_unstable;
|
|
17
17
|
},
|
|
18
|
-
useToolbarDividerStyles_unstable
|
|
18
|
+
get useToolbarDividerStyles_unstable () {
|
|
19
19
|
return _index.useToolbarDividerStyles_unstable;
|
|
20
20
|
},
|
|
21
|
-
useToolbarDivider_unstable
|
|
21
|
+
get useToolbarDivider_unstable () {
|
|
22
22
|
return _index.useToolbarDivider_unstable;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ToolbarGroup
|
|
12
|
+
get ToolbarGroup () {
|
|
13
13
|
return _index.ToolbarGroup;
|
|
14
14
|
},
|
|
15
|
-
renderToolbarGroup_unstable
|
|
15
|
+
get renderToolbarGroup_unstable () {
|
|
16
16
|
return _index.renderToolbarGroup_unstable;
|
|
17
17
|
},
|
|
18
|
-
toolbarGroupClassNames
|
|
18
|
+
get toolbarGroupClassNames () {
|
|
19
19
|
return _index.toolbarGroupClassNames;
|
|
20
20
|
},
|
|
21
|
-
useToolbarGroupStyles_unstable
|
|
21
|
+
get useToolbarGroupStyles_unstable () {
|
|
22
22
|
return _index.useToolbarGroupStyles_unstable;
|
|
23
23
|
},
|
|
24
|
-
useToolbarGroup_unstable
|
|
24
|
+
get useToolbarGroup_unstable () {
|
|
25
25
|
return _index.useToolbarGroup_unstable;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ToolbarRadioButton
|
|
12
|
+
get ToolbarRadioButton () {
|
|
13
13
|
return _index.ToolbarRadioButton;
|
|
14
14
|
},
|
|
15
|
-
useToolbarRadioButtonBase_unstable
|
|
15
|
+
get useToolbarRadioButtonBase_unstable () {
|
|
16
16
|
return _index.useToolbarRadioButtonBase_unstable;
|
|
17
17
|
},
|
|
18
|
-
useToolbarRadioButtonStyles_unstable
|
|
18
|
+
get useToolbarRadioButtonStyles_unstable () {
|
|
19
19
|
return _index.useToolbarRadioButtonStyles_unstable;
|
|
20
20
|
},
|
|
21
|
-
useToolbarRadioButton_unstable
|
|
21
|
+
get useToolbarRadioButton_unstable () {
|
|
22
22
|
return _index.useToolbarRadioButton_unstable;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -5,20 +5,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
ToolbarToggleButton
|
|
12
|
+
get ToolbarToggleButton () {
|
|
13
13
|
return _index.ToolbarToggleButton;
|
|
14
14
|
},
|
|
15
|
-
useToolbarToggleButtonBase_unstable
|
|
15
|
+
get useToolbarToggleButtonBase_unstable () {
|
|
16
16
|
return _index.useToolbarToggleButtonBase_unstable;
|
|
17
17
|
},
|
|
18
|
-
useToolbarToggleButtonStyles_unstable
|
|
18
|
+
get useToolbarToggleButtonStyles_unstable () {
|
|
19
19
|
return _index.useToolbarToggleButtonStyles_unstable;
|
|
20
20
|
},
|
|
21
|
-
useToolbarToggleButton_unstable
|
|
21
|
+
get useToolbarToggleButton_unstable () {
|
|
22
22
|
return _index.useToolbarToggleButton_unstable;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/Toolbar.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useToolbar_unstable } from './useToolbar';\nimport { renderToolbar_unstable } from './renderToolbar';\nimport { useToolbarStyles_unstable } from './useToolbarStyles.styles';\nimport type { ToolbarProps } from './Toolbar.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToolbarContextValues_unstable } from './useToolbarContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Toolbar component\n */\nexport const Toolbar: ForwardRefComponent<ToolbarProps> = React.forwardRef((props, ref) => {\n const state = useToolbar_unstable(props, ref);\n const contextValues = useToolbarContextValues_unstable(state);\n\n useToolbarStyles_unstable(state);\n\n useCustomStyleHook_unstable('useToolbarStyles_unstable')(state);\n\n return renderToolbar_unstable(state, contextValues);\n});\n\nToolbar.displayName = 'Toolbar';\n"],"names":["React","useToolbar_unstable","renderToolbar_unstable","useToolbarStyles_unstable","useToolbarContextValues_unstable","useCustomStyleHook_unstable","Toolbar","forwardRef","props","ref","state","contextValues","displayName"],"mappings":"AAAA;;;;;;;;;;;;iEAEuB,QAAQ;4BACK,kBAAe;+BACZ,qBAAkB;wCACf,+BAA4B;yCAGrB,+BAA4B;qCACjC,kCAAkC;AAKvE,MAAMM,UAAAA,WAAAA,GAA6CN,OAAMO,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,YAAQT,+BAAAA,EAAoBO,OAAOC;IACzC,MAAME,oBAAgBP,yDAAAA,EAAiCM;QAEvDP,iDAAAA,EAA0BO;QAE1BL,gDAAAA,EAA4B,6BAA6BK;IAEzD,WAAOR,qCAAAA,EAAuBQ,OAAOC;AACvC,GAAG;AAEHL,QAAQM,WAAW,GAAG"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
@layer fluentui {
|
|
2
|
+
.root {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: var(--spacingHorizontalXS) var(--spacingHorizontalS);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.vertical {
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
width: fit-content;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.small:where(:not(.vertical)) {
|
|
14
|
+
padding: 0px var(--spacingHorizontalXS);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.medium:where(:not(.vertical)) {
|
|
18
|
+
padding: var(--spacingHorizontalXS) var(--spacingHorizontalS);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.large:where(:not(.vertical)) {
|
|
22
|
+
padding: var(--spacingHorizontalXS) var(--spacingHorizontalXL);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/Toolbar.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ToolbarSlots = {\n root: Slot<'div'>;\n};\n\nexport type ToolbarCheckedValueChangeData = {\n /** The items for this value that are checked */\n checkedItems: string[];\n /** The name of the value */\n name: string;\n};\n\nexport type ToolbarCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;\n\n/**\n * Toolbar Props\n */\nexport type ToolbarProps = ComponentProps<ToolbarSlots> & {\n /**\n * Toolbar can have small or medium size\n *\n * @default medium\n */\n size?: 'small' | 'medium' | 'large';\n\n /**\n * Toolbar can be vertical styled\n * @default false\n */\n vertical?: boolean;\n\n /**\n * Map of all checked values\n */\n checkedValues?: Record<string, string[]>;\n\n /**\n * Default values to be checked on mount\n */\n defaultCheckedValues?: Record<string, string[]>;\n\n /**\n * Callback when checked items change for value with a name\n *\n * @param event - React's original SyntheticEvent\n * @param data - A data object with relevant information\n */\n // eslint-disable-next-line @nx/workspace-consistent-callback-type -- can't change type of existing callback\n onCheckedValueChange?: (e: ToolbarCheckedValueChangeEvent, data: ToolbarCheckedValueChangeData) => void;\n};\n\nexport type ToolbarBaseProps = Omit<ToolbarProps, 'size'>;\n\n/**\n * State used in rendering Toolbar\n */\nexport type ToolbarState = ComponentState<ToolbarSlots> &\n Required<Pick<ToolbarProps, 'size' | 'checkedValues' | 'vertical'>> &\n Pick<ToolbarProps, 'defaultCheckedValues' | 'onCheckedValueChange'> & {\n /*\n * Toggles the state of a ToggleButton item\n */\n handleToggleButton: ToggableHandler;\n /*\n * Toggles the state of a ToggleButton item\n */\n handleRadio: ToggableHandler;\n };\n\nexport type ToolbarBaseState = Omit<ToolbarState, 'size'>;\n\nexport type ToolbarContextValue = Pick<ToolbarState, 'size' | 'vertical' | 'checkedValues'> & {\n handleToggleButton?: ToggableHandler;\n handleRadio?: ToggableHandler;\n};\n\nexport type ToolbarContextValues = {\n toolbar: ToolbarContextValue;\n};\n\nexport type UninitializedToolbarState = Omit<ToolbarBaseState, 'checkedValues' | 'handleToggleButton' | 'handleRadio'> &\n Partial<Pick<ToolbarState, 'checkedValues'>>;\n\nexport type ToggableHandler = (\n e: React.MouseEvent | React.KeyboardEvent,\n name: string,\n value: string,\n checked?: boolean,\n) => void;\n"],"names":[],"mappings":""}
|