@fluentui/react-toolbar 9.1.16 → 9.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +70 -1
- package/CHANGELOG.md +20 -2
- package/lib/Toolbar.js +0 -1
- package/lib/Toolbar.js.map +1 -1
- package/lib/ToolbarButton.js +0 -1
- package/lib/ToolbarButton.js.map +1 -1
- package/lib/ToolbarDivider.js +0 -1
- package/lib/ToolbarDivider.js.map +1 -1
- package/lib/ToolbarGroup.js +0 -1
- package/lib/ToolbarGroup.js.map +1 -1
- package/lib/ToolbarRadioButton.js +0 -1
- package/lib/ToolbarRadioButton.js.map +1 -1
- package/lib/ToolbarRadioGroup.js +0 -1
- package/lib/ToolbarRadioGroup.js.map +1 -1
- package/lib/ToolbarToggleButton.js +0 -1
- package/lib/ToolbarToggleButton.js.map +1 -1
- package/lib/components/Toolbar/Toolbar.js +6 -8
- package/lib/components/Toolbar/Toolbar.js.map +1 -1
- package/lib/components/Toolbar/Toolbar.types.js +0 -1
- package/lib/components/Toolbar/Toolbar.types.js.map +1 -1
- package/lib/components/Toolbar/ToolbarContext.js +7 -8
- package/lib/components/Toolbar/ToolbarContext.js.map +1 -1
- package/lib/components/Toolbar/index.js +0 -1
- package/lib/components/Toolbar/index.js.map +1 -1
- package/lib/components/Toolbar/renderToolbar.js +6 -11
- package/lib/components/Toolbar/renderToolbar.js.map +1 -1
- package/lib/components/Toolbar/useToolbar.js +90 -94
- package/lib/components/Toolbar/useToolbar.js.map +1 -1
- package/lib/components/Toolbar/useToolbarContextValues.js +12 -19
- package/lib/components/Toolbar/useToolbarContextValues.js.map +1 -1
- package/lib/components/Toolbar/useToolbarStyles.styles.js.map +1 -1
- package/lib/components/ToolbarButton/ToolbarButton.js +6 -9
- package/lib/components/ToolbarButton/ToolbarButton.js.map +1 -1
- package/lib/components/ToolbarButton/ToolbarButton.types.js +1 -2
- package/lib/components/ToolbarButton/ToolbarButton.types.js.map +1 -1
- package/lib/components/ToolbarButton/index.js +0 -1
- package/lib/components/ToolbarButton/index.js.map +1 -1
- package/lib/components/ToolbarButton/useToolbarButton.js +10 -15
- package/lib/components/ToolbarButton/useToolbarButton.js.map +1 -1
- package/lib/components/ToolbarButton/useToolbarButtonStyles.styles.js.map +1 -1
- package/lib/components/ToolbarDivider/ToolbarDivider.js +5 -7
- package/lib/components/ToolbarDivider/ToolbarDivider.js.map +1 -1
- package/lib/components/ToolbarDivider/ToolbarDivider.types.js +1 -2
- package/lib/components/ToolbarDivider/ToolbarDivider.types.js.map +1 -1
- package/lib/components/ToolbarDivider/index.js +0 -1
- package/lib/components/ToolbarDivider/index.js.map +1 -1
- package/lib/components/ToolbarDivider/useToolbarDivider.js +6 -8
- package/lib/components/ToolbarDivider/useToolbarDivider.js.map +1 -1
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.styles.js +1 -1
- package/lib/components/ToolbarDivider/useToolbarDividerStyles.styles.js.map +1 -1
- package/lib/components/ToolbarGroup/ToolbarGroup.js +6 -9
- package/lib/components/ToolbarGroup/ToolbarGroup.js.map +1 -1
- package/lib/components/ToolbarGroup/ToolbarGroup.types.js +1 -2
- package/lib/components/ToolbarGroup/ToolbarGroup.types.js.map +1 -1
- package/lib/components/ToolbarGroup/index.js +0 -1
- package/lib/components/ToolbarGroup/index.js.map +1 -1
- package/lib/components/ToolbarGroup/renderToolbarGroup.js +4 -9
- package/lib/components/ToolbarGroup/renderToolbarGroup.js.map +1 -1
- package/lib/components/ToolbarGroup/useToolbarGroup.js +11 -13
- package/lib/components/ToolbarGroup/useToolbarGroup.js.map +1 -1
- package/lib/components/ToolbarGroup/useToolbarGroupStyles.styles.js.map +1 -1
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.js +5 -7
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.js.map +1 -1
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.types.js +1 -2
- package/lib/components/ToolbarRadioButton/ToolbarRadioButton.types.js.map +1 -1
- package/lib/components/ToolbarRadioButton/index.js +0 -1
- package/lib/components/ToolbarRadioButton/index.js.map +1 -1
- package/lib/components/ToolbarRadioButton/useToolbarRadioButton.js +27 -31
- package/lib/components/ToolbarRadioButton/useToolbarRadioButton.js.map +1 -1
- package/lib/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.js.map +1 -1
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.js +9 -12
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.js.map +1 -1
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.types.js +1 -2
- package/lib/components/ToolbarRadioGroup/ToolbarRadioGroup.types.js.map +1 -1
- package/lib/components/ToolbarRadioGroup/index.js +0 -1
- package/lib/components/ToolbarRadioGroup/index.js.map +1 -1
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.js +5 -7
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.js.map +1 -1
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.types.js +1 -2
- package/lib/components/ToolbarToggleButton/ToolbarToggleButton.types.js.map +1 -1
- package/lib/components/ToolbarToggleButton/index.js +0 -1
- package/lib/components/ToolbarToggleButton/index.js.map +1 -1
- package/lib/components/ToolbarToggleButton/useToolbarToggleButton.js +27 -31
- package/lib/components/ToolbarToggleButton/useToolbarToggleButton.js.map +1 -1
- package/lib/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.js.map +1 -1
- package/lib/index.js +0 -1
- package/lib/index.js.map +1 -1
- package/lib-commonjs/Toolbar.js +0 -3
- package/lib-commonjs/Toolbar.js.map +1 -1
- package/lib-commonjs/ToolbarButton.js +0 -3
- package/lib-commonjs/ToolbarButton.js.map +1 -1
- package/lib-commonjs/ToolbarDivider.js +0 -3
- package/lib-commonjs/ToolbarDivider.js.map +1 -1
- package/lib-commonjs/ToolbarGroup.js +0 -3
- package/lib-commonjs/ToolbarGroup.js.map +1 -1
- package/lib-commonjs/ToolbarRadioButton.js +0 -3
- package/lib-commonjs/ToolbarRadioButton.js.map +1 -1
- package/lib-commonjs/ToolbarRadioGroup.js +0 -3
- package/lib-commonjs/ToolbarRadioGroup.js.map +1 -1
- package/lib-commonjs/ToolbarToggleButton.js +0 -3
- package/lib-commonjs/ToolbarToggleButton.js.map +1 -1
- package/lib-commonjs/components/Toolbar/Toolbar.js +1 -3
- package/lib-commonjs/components/Toolbar/Toolbar.js.map +1 -1
- package/lib-commonjs/components/Toolbar/Toolbar.types.js +0 -3
- package/lib-commonjs/components/Toolbar/Toolbar.types.js.map +1 -1
- package/lib-commonjs/components/Toolbar/ToolbarContext.js +2 -4
- package/lib-commonjs/components/Toolbar/ToolbarContext.js.map +1 -1
- package/lib-commonjs/components/Toolbar/index.js +0 -3
- package/lib-commonjs/components/Toolbar/index.js.map +1 -1
- package/lib-commonjs/components/Toolbar/renderToolbar.js +1 -3
- package/lib-commonjs/components/Toolbar/renderToolbar.js.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbar.js +1 -3
- package/lib-commonjs/components/Toolbar/useToolbar.js.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbarContextValues.js +1 -3
- package/lib-commonjs/components/Toolbar/useToolbarContextValues.js.map +1 -1
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.js +0 -2
- package/lib-commonjs/components/Toolbar/useToolbarStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.js +1 -3
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.types.js +0 -3
- package/lib-commonjs/components/ToolbarButton/ToolbarButton.types.js.map +1 -1
- package/lib-commonjs/components/ToolbarButton/index.js +0 -3
- package/lib-commonjs/components/ToolbarButton/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarButton/useToolbarButton.js +1 -3
- package/lib-commonjs/components/ToolbarButton/useToolbarButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.styles.js +0 -2
- package/lib-commonjs/components/ToolbarButton/useToolbarButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.js +1 -3
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.js.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.types.js +0 -3
- package/lib-commonjs/components/ToolbarDivider/ToolbarDivider.types.js.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/index.js +0 -3
- package/lib-commonjs/components/ToolbarDivider/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/useToolbarDivider.js +1 -3
- package/lib-commonjs/components/ToolbarDivider/useToolbarDivider.js.map +1 -1
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.styles.js +1 -3
- package/lib-commonjs/components/ToolbarDivider/useToolbarDividerStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.js +1 -3
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.js.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.types.js +0 -3
- package/lib-commonjs/components/ToolbarGroup/ToolbarGroup.types.js.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/index.js +0 -3
- package/lib-commonjs/components/ToolbarGroup/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/renderToolbarGroup.js +1 -3
- package/lib-commonjs/components/ToolbarGroup/renderToolbarGroup.js.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroup.js +1 -3
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroup.js.map +1 -1
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.js +0 -2
- package/lib-commonjs/components/ToolbarGroup/useToolbarGroupStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.js +1 -3
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.types.js +0 -3
- package/lib-commonjs/components/ToolbarRadioButton/ToolbarRadioButton.types.js.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/index.js +0 -3
- package/lib-commonjs/components/ToolbarRadioButton/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButton.js +1 -3
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.js +0 -2
- package/lib-commonjs/components/ToolbarRadioButton/useToolbarRadioButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/components/ToolbarRadioGroup/ToolbarRadioGroup.js +1 -3
- package/lib-commonjs/components/ToolbarRadioGroup/ToolbarRadioGroup.js.map +1 -1
- package/lib-commonjs/components/ToolbarRadioGroup/ToolbarRadioGroup.types.js +0 -3
- package/lib-commonjs/components/ToolbarRadioGroup/ToolbarRadioGroup.types.js.map +1 -1
- package/lib-commonjs/components/ToolbarRadioGroup/index.js +0 -3
- package/lib-commonjs/components/ToolbarRadioGroup/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.js +1 -3
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.types.js +0 -3
- package/lib-commonjs/components/ToolbarToggleButton/ToolbarToggleButton.types.js.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/index.js +0 -3
- package/lib-commonjs/components/ToolbarToggleButton/index.js.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButton.js +1 -3
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButton.js.map +1 -1
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.js +0 -2
- package/lib-commonjs/components/ToolbarToggleButton/useToolbarToggleButtonStyles.styles.js.map +1 -1
- package/lib-commonjs/index.js +0 -3
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -4,17 +4,14 @@ import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
|
4
4
|
/**
|
|
5
5
|
* ToolbarRadioGroup component is a Button to be used inside Toolbar
|
|
6
6
|
* which will respect toolbar props such as `size`
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// Casting is required due to lack of distributive union to support unions on @types/react
|
|
7
|
+
*/ export const ToolbarRadioGroup = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
8
|
+
const state = useToolbarGroup_unstable({
|
|
9
|
+
role: 'radiogroup',
|
|
10
|
+
...props
|
|
11
|
+
}, ref);
|
|
12
|
+
useToolbarGroupStyles_unstable(state);
|
|
13
|
+
useCustomStyleHook_unstable('useToolbarGroupStyles_unstable')(state);
|
|
14
|
+
return renderToolbarGroup_unstable(state);
|
|
15
|
+
// Casting is required due to lack of distributive union to support unions on @types/react
|
|
17
16
|
});
|
|
18
|
-
|
|
19
17
|
ToolbarRadioGroup.displayName = 'ToolbarRadioGroup';
|
|
20
|
-
//# sourceMappingURL=ToolbarRadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["ToolbarRadioGroup.tsx"],"sourcesContent":["import * 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,YAAYA,WAAW,QAAQ;AAG/B,SACEC,2BAA2B,EAC3BC,8BAA8B,EAC9BC,wBAAwB,QACnB,qBAAqB;AAC5B,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,kCAAiEL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC7G,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,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=ToolbarRadioGroup.types.js.map
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["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":"AAAA,WAc4E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ToolbarRadioGroup';\nexport * from './ToolbarRadioGroup.types';\n"],"names":[],"mappings":"AAAA,cAAc,sBAAsB;AACpC,cAAc,4BAA4B"}
|
|
@@ -5,12 +5,10 @@ import { useToolbarToggleButtonStyles_unstable } from './useToolbarToggleButtonS
|
|
|
5
5
|
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* ToolbarToggleButton component
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return renderToggleButton_unstable(state);
|
|
8
|
+
*/ export const ToolbarToggleButton = /*#__PURE__*/ React.forwardRef((props, ref)=>{
|
|
9
|
+
const state = useToolbarToggleButton_unstable(props, ref);
|
|
10
|
+
useToolbarToggleButtonStyles_unstable(state);
|
|
11
|
+
useCustomStyleHook_unstable('useToolbarToggleButtonStyles_unstable')(state);
|
|
12
|
+
return renderToggleButton_unstable(state);
|
|
14
13
|
});
|
|
15
14
|
ToolbarToggleButton.displayName = 'ToolbarToggleButton';
|
|
16
|
-
//# sourceMappingURL=ToolbarToggleButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["ToolbarToggleButton.tsx"],"sourcesContent":["import * 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,YAAYA,WAAW,QAAQ;AAG/B,SAASC,2BAA2B,QAAQ,yBAAyB;AACrE,SAASC,+BAA+B,QAAQ,2BAA2B;AAC3E,SAASC,qCAAqC,QAAQ,wCAAwC;AAC9F,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,oCAAqEL,MAAMM,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACjH,MAAMC,QAAQP,gCAAgCK,OAAOC;IAErDL,sCAAsCM;IAEtCL,4BAA4B,yCAAyCK;IAErE,OAAOR,4BAA4BQ;AACrC,GAAoD;AAEpDJ,oBAAoBK,WAAW,GAAG"}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export {};
|
|
2
|
-
//# sourceMappingURL=ToolbarToggleButton.types.js.map
|
|
1
|
+
export { };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["ToolbarToggleButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport { 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';\n name: string;\n value: string;\n };\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"],"names":[],"mappings":"AAAA,WAmBmD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export * from './ToolbarToggleButton';\nexport * from './ToolbarToggleButton.types';\nexport * from './useToolbarToggleButton';\nexport * from './useToolbarToggleButtonStyles.styles';\n"],"names":[],"mappings":"AAAA,cAAc,wBAAwB;AACtC,cAAc,8BAA8B;AAC5C,cAAc,2BAA2B;AACzC,cAAc,wCAAwC"}
|
|
@@ -6,35 +6,31 @@ import { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';
|
|
|
6
6
|
* processed state.
|
|
7
7
|
* @param props - User provided props to the ToggleButton component.
|
|
8
8
|
* @param ref - User provided ref to be passed to the ToggleButton component.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
state.root.onClick = handleOnClick;
|
|
38
|
-
return state;
|
|
9
|
+
*/ export const useToolbarToggleButton_unstable = (props, ref)=>{
|
|
10
|
+
const handleToggleButton = useToolbarContext_unstable((ctx)=>ctx.handleToggleButton);
|
|
11
|
+
const checked = useToolbarContext_unstable((ctx)=>{
|
|
12
|
+
var _ctx_checkedValues_props_name;
|
|
13
|
+
return !!((_ctx_checkedValues_props_name = ctx.checkedValues[props.name]) === null || _ctx_checkedValues_props_name === void 0 ? void 0 : _ctx_checkedValues_props_name.includes(props.value));
|
|
14
|
+
});
|
|
15
|
+
const { onClick: onClickOriginal } = props;
|
|
16
|
+
const toggleButtonState = useToggleButton_unstable({
|
|
17
|
+
checked,
|
|
18
|
+
...props
|
|
19
|
+
}, ref);
|
|
20
|
+
const state = {
|
|
21
|
+
...toggleButtonState,
|
|
22
|
+
name: props.name,
|
|
23
|
+
value: props.value
|
|
24
|
+
};
|
|
25
|
+
const handleOnClick = (e)=>{
|
|
26
|
+
if (state.disabled) {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
handleToggleButton === null || handleToggleButton === void 0 ? void 0 : handleToggleButton(e, state.name, state.value, state.checked);
|
|
32
|
+
onClickOriginal === null || onClickOriginal === void 0 ? void 0 : onClickOriginal(e);
|
|
33
|
+
};
|
|
34
|
+
state.root.onClick = handleOnClick;
|
|
35
|
+
return state;
|
|
39
36
|
};
|
|
40
|
-
//# sourceMappingURL=useToolbarToggleButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["useToolbarToggleButton.ts"],"sourcesContent":["import * as React from 'react';\nimport { useToggleButton_unstable } from '@fluentui/react-button';\nimport { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';\nimport { ToolbarToggleButtonProps, ToolbarToggleButtonState } 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 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 = useToggleButton_unstable({ checked, ...props }, ref);\n const state: ToolbarToggleButtonState = {\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) {\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":["React","useToggleButton_unstable","useToolbarContext_unstable","useToolbarToggleButton_unstable","props","ref","handleToggleButton","ctx","checked","checkedValues","name","includes","value","onClick","onClickOriginal","toggleButtonState","state","handleOnClick","e","disabled","preventDefault","stopPropagation","root"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,QAAQ,yBAAyB;AAClE,SAASC,0BAA0B,QAAQ,4BAA4B;AAGvE;;;;;CAKC,GACD,OAAO,MAAMC,kCAAkC,CAC7CC,OACAC,MAC6B;IAC7B,MAAMC,qBAAqBJ,2BAA2BK,CAAAA,MAAOA,IAAID,kBAAkB;IACnF,MAAME,UAAUN,2BAA2BK,CAAAA;YAASA;QAAF,OAAA,CAAC,EAACA,CAAAA,gCAAAA,IAAIE,aAAa,CAACL,MAAMM,IAAI,CAAC,cAA7BH,2CAAAA,KAAAA,IAAAA,8BAA+BI,SAASP,MAAMQ,KAAK;;IAEvG,MAAM,EAAEC,SAASC,gBAAe,EAAE,GAAGV;IACrC,MAAMW,oBAAoBd,yBAAyB;QAAEO;QAAS,GAAGJ,KAAK;IAAC,GAAGC;IAC1E,MAAMW,QAAkC;QACtC,GAAGD,iBAAiB;QACpBL,MAAMN,MAAMM,IAAI;QAChBE,OAAOR,MAAMQ,KAAK;IACpB;IAEA,MAAMK,gBAAgB,CACpBC,IACG;QACH,IAAIF,MAAMG,QAAQ,EAAE;YAClBD,EAAEE,cAAc;YAChBF,EAAEG,eAAe;YACjB;QACF,CAAC;QAEDf,+BAAAA,gCAAAA,KAAAA,IAAAA,mBAAqBY,GAAGF,MAAMN,IAAI,EAAEM,MAAMJ,KAAK,EAAEI,MAAMR,OAAO;QAC9DM,4BAAAA,6BAAAA,KAAAA,IAAAA,gBAAkBI;IACpB;IAEAF,MAAMM,IAAI,CAACT,OAAO,GAAGI;IACrB,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["tokens","__styles","mergeClasses","useToggleButtonStyles_unstable","useBaseStyles","selected","sj55zd","d","useToolbarToggleButtonStyles_unstable","state","toggleButtonStyles","root","className","checked"],"sources":["
|
|
1
|
+
{"version":3,"names":["tokens","__styles","mergeClasses","useToggleButtonStyles_unstable","useBaseStyles","selected","sj55zd","d","useToolbarToggleButtonStyles_unstable","state","toggleButtonStyles","root","className","checked"],"sources":["useToolbarToggleButtonStyles.styles.js"],"sourcesContent":["import { tokens } from '@fluentui/react-theme';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useToggleButtonStyles_unstable } from '@fluentui/react-button';\nconst useBaseStyles = makeStyles({\n selected: {\n color: tokens.colorBrandForeground1\n }\n});\n/**\n * Apply styling to the ToolbarToggleButton slots based on the state\n */ export const useToolbarToggleButtonStyles_unstable = (state)=>{\n useToggleButtonStyles_unstable(state);\n const toggleButtonStyles = useBaseStyles();\n state.root.className = mergeClasses(state.root.className, state.checked && toggleButtonStyles.selected);\n};\n"],"mappings":"AAAA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAAAC,QAAA,EAAqBC,YAAY,QAAQ,gBAAgB;AACzD,SAASC,8BAA8B,QAAQ,wBAAwB;AACvE,MAAMC,aAAa,gBAAGH,QAAA;EAAAI,QAAA;IAAAC,MAAA;EAAA;AAAA;EAAAC,CAAA;AAAA,CAIrB,CAAC;AACF;AACA;AACA;AAAI,OAAO,MAAMC,qCAAqC,GAAIC,KAAK,IAAG;EAC9DN,8BAA8B,CAACM,KAAK,CAAC;EACrC,MAAMC,kBAAkB,GAAGN,aAAa,CAAC,CAAC;EAC1CK,KAAK,CAACE,IAAI,CAACC,SAAS,GAAGV,YAAY,CAACO,KAAK,CAACE,IAAI,CAACC,SAAS,EAAEH,KAAK,CAACI,OAAO,IAAIH,kBAAkB,CAACL,QAAQ,CAAC;AAC3G,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -5,4 +5,3 @@ export { ToolbarToggleButton, useToolbarToggleButtonStyles_unstable, useToolbarT
|
|
|
5
5
|
export { ToolbarRadioButton, useToolbarRadioButtonStyles_unstable, useToolbarRadioButton_unstable } from './ToolbarRadioButton';
|
|
6
6
|
export { ToolbarGroup, useToolbarGroupStyles_unstable, useToolbarGroup_unstable, renderToolbarGroup_unstable, toolbarGroupClassNames } from './ToolbarGroup';
|
|
7
7
|
export { ToolbarRadioGroup } from './ToolbarRadioGroup';
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"sources":["index.ts"],"sourcesContent":["export {\n Toolbar,\n renderToolbar_unstable,\n toolbarClassNames,\n useToolbarStyles_unstable,\n useToolbar_unstable,\n} from './Toolbar';\nexport type { ToolbarContextValue, ToolbarContextValues, ToolbarProps, ToolbarSlots, ToolbarState } from './Toolbar';\nexport { ToolbarButton, useToolbarButtonStyles_unstable, useToolbarButton_unstable } from './ToolbarButton';\nexport type { ToolbarButtonProps, ToolbarButtonState } from './ToolbarButton';\nexport { ToolbarDivider, useToolbarDividerStyles_unstable, useToolbarDivider_unstable } from './ToolbarDivider';\nexport type { ToolbarDividerProps, ToolbarDividerState } from './ToolbarDivider';\nexport {\n ToolbarToggleButton,\n useToolbarToggleButtonStyles_unstable,\n useToolbarToggleButton_unstable,\n} from './ToolbarToggleButton';\nexport type { ToolbarToggleButtonProps, ToolbarToggleButtonState } from './ToolbarToggleButton';\nexport {\n ToolbarRadioButton,\n useToolbarRadioButtonStyles_unstable,\n useToolbarRadioButton_unstable,\n} from './ToolbarRadioButton';\nexport type { ToolbarRadioButtonProps, ToolbarRadioButtonState } from './ToolbarRadioButton';\nexport {\n ToolbarGroup,\n useToolbarGroupStyles_unstable,\n useToolbarGroup_unstable,\n renderToolbarGroup_unstable,\n toolbarGroupClassNames,\n} from './ToolbarGroup';\nexport type { ToolbarGroupProps, ToolbarGroupState } from './ToolbarGroup';\nexport { ToolbarRadioGroup } from './ToolbarRadioGroup';\nexport type { ToolbarRadioGroupProps, ToolbarRadioGroupState } from './ToolbarRadioGroup';\n"],"names":["Toolbar","renderToolbar_unstable","toolbarClassNames","useToolbarStyles_unstable","useToolbar_unstable","ToolbarButton","useToolbarButtonStyles_unstable","useToolbarButton_unstable","ToolbarDivider","useToolbarDividerStyles_unstable","useToolbarDivider_unstable","ToolbarToggleButton","useToolbarToggleButtonStyles_unstable","useToolbarToggleButton_unstable","ToolbarRadioButton","useToolbarRadioButtonStyles_unstable","useToolbarRadioButton_unstable","ToolbarGroup","useToolbarGroupStyles_unstable","useToolbarGroup_unstable","renderToolbarGroup_unstable","toolbarGroupClassNames","ToolbarRadioGroup"],"mappings":"AAAA,SACEA,OAAO,EACPC,sBAAsB,EACtBC,iBAAiB,EACjBC,yBAAyB,EACzBC,mBAAmB,QACd,YAAY;AAEnB,SAASC,aAAa,EAAEC,+BAA+B,EAAEC,yBAAyB,QAAQ,kBAAkB;AAE5G,SAASC,cAAc,EAAEC,gCAAgC,EAAEC,0BAA0B,QAAQ,mBAAmB;AAEhH,SACEC,mBAAmB,EACnBC,qCAAqC,EACrCC,+BAA+B,QAC1B,wBAAwB;AAE/B,SACEC,kBAAkB,EAClBC,oCAAoC,EACpCC,8BAA8B,QACzB,uBAAuB;AAE9B,SACEC,YAAY,EACZC,8BAA8B,EAC9BC,wBAAwB,EACxBC,2BAA2B,EAC3BC,sBAAsB,QACjB,iBAAiB;AAExB,SAASC,iBAAiB,QAAQ,sBAAsB"}
|
package/lib-commonjs/Toolbar.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["Toolbar.js"],"sourcesContent":["export * from './components/Toolbar/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/ToolbarButton/index"), exports);
|
|
7
|
-
//# sourceMappingURL=ToolbarButton.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ToolbarButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["ToolbarButton.js"],"sourcesContent":["export * from './components/ToolbarButton/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/ToolbarDivider/index"), exports);
|
|
7
|
-
//# sourceMappingURL=ToolbarDivider.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ToolbarDivider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["ToolbarDivider.js"],"sourcesContent":["export * from './components/ToolbarDivider/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/ToolbarGroup/index"), exports);
|
|
7
|
-
//# sourceMappingURL=ToolbarGroup.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ToolbarGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["ToolbarGroup.js"],"sourcesContent":["export * from './components/ToolbarGroup/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/ToolbarRadioButton/index"), exports);
|
|
7
|
-
//# sourceMappingURL=ToolbarRadioButton.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ToolbarRadioButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["ToolbarRadioButton.js"],"sourcesContent":["export * from './components/ToolbarRadioButton/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/ToolbarRadioGroup/index"), exports);
|
|
7
|
-
//# sourceMappingURL=ToolbarRadioGroup.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ToolbarRadioGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["ToolbarRadioGroup.js"],"sourcesContent":["export * from './components/ToolbarRadioGroup/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
6
6
|
_exportStar(require("./components/ToolbarToggleButton/index"), exports);
|
|
7
|
-
//# sourceMappingURL=ToolbarToggleButton.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=ToolbarToggleButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["ToolbarToggleButton.js"],"sourcesContent":["export * from './components/ToolbarToggleButton/index';\n"],"names":[],"mappings":";;;;;oBAAc"}
|
|
@@ -20,6 +20,4 @@ const Toolbar = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
20
20
|
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useToolbarStyles_unstable')(state);
|
|
21
21
|
return (0, _renderToolbar.renderToolbar_unstable)(state, contextValues);
|
|
22
22
|
});
|
|
23
|
-
Toolbar.displayName = 'Toolbar';
|
|
24
|
-
|
|
25
|
-
//# sourceMappingURL=Toolbar.js.map
|
|
23
|
+
Toolbar.displayName = 'Toolbar';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["Toolbar.js"],"sourcesContent":["import * as React from 'react';\nimport { useToolbar_unstable } from './useToolbar';\nimport { renderToolbar_unstable } from './renderToolbar';\nimport { useToolbarStyles_unstable } from './useToolbarStyles.styles';\nimport { useToolbarContextValues_unstable } from './useToolbarContextValues';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Toolbar component\n */ export const Toolbar = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useToolbar_unstable(props, ref);\n const contextValues = useToolbarContextValues_unstable(state);\n useToolbarStyles_unstable(state);\n useCustomStyleHook_unstable('useToolbarStyles_unstable')(state);\n return renderToolbar_unstable(state, contextValues);\n});\nToolbar.displayName = 'Toolbar';\n"],"names":["Toolbar","React","forwardRef","props","ref","state","useToolbar_unstable","contextValues","useToolbarContextValues_unstable","useToolbarStyles_unstable","useCustomStyleHook_unstable","renderToolbar_unstable","displayName"],"mappings":";;;;+BAQiBA;;aAAAA;;;6DARM;4BACa;+BACG;wCACG;yCACO;qCACL;AAGjC,MAAMA,UAAU,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IACpE,MAAMC,QAAQC,IAAAA,+BAAmB,EAACH,OAAOC;IACzC,MAAMG,gBAAgBC,IAAAA,yDAAgC,EAACH;IACvDI,IAAAA,iDAAyB,EAACJ;IAC1BK,IAAAA,gDAA2B,EAAC,6BAA6BL;IACzD,OAAOM,IAAAA,qCAAsB,EAACN,OAAOE;AACzC;AACAP,QAAQY,WAAW,GAAG"}
|
|
@@ -4,6 +4,3 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
const _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
6
6
|
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
7
|
-
//# sourceMappingURL=Toolbar.types.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=Toolbar.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["Toolbar.types.js"],"sourcesContent":["import * as React from 'react';\n"],"names":[],"mappings":";;;;;6DAAuB"}
|
|
@@ -13,7 +13,7 @@ _export(exports, {
|
|
|
13
13
|
useToolbarContext_unstable: ()=>useToolbarContext_unstable
|
|
14
14
|
});
|
|
15
15
|
const _reactContextSelector = require("@fluentui/react-context-selector");
|
|
16
|
-
const ToolbarContext =
|
|
16
|
+
const ToolbarContext = (0, _reactContextSelector.createContext)(undefined);
|
|
17
17
|
const toolbarContextDefaultValue = {
|
|
18
18
|
size: 'medium',
|
|
19
19
|
handleToggleButton: ()=>null,
|
|
@@ -21,6 +21,4 @@ const toolbarContextDefaultValue = {
|
|
|
21
21
|
vertical: false,
|
|
22
22
|
checkedValues: {}
|
|
23
23
|
};
|
|
24
|
-
const useToolbarContext_unstable = (selector)=>(0, _reactContextSelector.useContextSelector)(ToolbarContext, (ctx = toolbarContextDefaultValue)=>selector(ctx));
|
|
25
|
-
|
|
26
|
-
//# sourceMappingURL=ToolbarContext.js.map
|
|
24
|
+
const useToolbarContext_unstable = (selector)=>(0, _reactContextSelector.useContextSelector)(ToolbarContext, (ctx = toolbarContextDefaultValue)=>selector(ctx));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["ToolbarContext.js"],"sourcesContent":["import { createContext, useContextSelector } from '@fluentui/react-context-selector';\nexport const ToolbarContext = createContext(undefined);\nconst toolbarContextDefaultValue = {\n size: 'medium',\n handleToggleButton: ()=>null,\n handleRadio: ()=>null,\n vertical: false,\n checkedValues: {}\n};\nexport const useToolbarContext_unstable = (selector)=>useContextSelector(ToolbarContext, (ctx = toolbarContextDefaultValue)=>selector(ctx));\n"],"names":["ToolbarContext","useToolbarContext_unstable","createContext","undefined","toolbarContextDefaultValue","size","handleToggleButton","handleRadio","vertical","checkedValues","selector","useContextSelector","ctx"],"mappings":";;;;;;;;;;;IACaA,cAAc,MAAdA;IAQAC,0BAA0B,MAA1BA;;sCATqC;AAC3C,MAAMD,iBAAiBE,IAAAA,mCAAa,EAACC;AAC5C,MAAMC,6BAA6B;IAC/BC,MAAM;IACNC,oBAAoB,IAAI,IAAI;IAC5BC,aAAa,IAAI,IAAI;IACrBC,UAAU,KAAK;IACfC,eAAe,CAAC;AACpB;AACO,MAAMR,6BAA6B,CAACS,WAAWC,IAAAA,wCAAkB,EAACX,gBAAgB,CAACY,MAAMR,0BAA0B,GAAGM,SAASE"}
|
|
@@ -8,6 +8,3 @@ _exportStar(require("./Toolbar.types"), exports);
|
|
|
8
8
|
_exportStar(require("./renderToolbar"), exports);
|
|
9
9
|
_exportStar(require("./useToolbar"), exports);
|
|
10
10
|
_exportStar(require("./useToolbarStyles.styles"), exports);
|
|
11
|
-
//# sourceMappingURL=index.js.map
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["index.js"],"sourcesContent":["export * from './Toolbar';\nexport * from './Toolbar.types';\nexport * from './renderToolbar';\nexport * from './useToolbar';\nexport * from './useToolbarStyles.styles';\n"],"names":[],"mappings":";;;;;oBAAc;oBACA;oBACA;oBACA;oBACA"}
|
|
@@ -14,6 +14,4 @@ const renderToolbar_unstable = (state, contextValues)=>{
|
|
|
14
14
|
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_toolbarContext.ToolbarContext.Provider, {
|
|
15
15
|
value: contextValues.toolbar
|
|
16
16
|
}, /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root, slotProps.root.children));
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
//# sourceMappingURL=renderToolbar.js.map
|
|
17
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["renderToolbar.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */ import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { ToolbarContext } from './ToolbarContext';\n/**\n * Render the final JSX of Toolbar\n */ export const renderToolbar_unstable = (state, contextValues)=>{\n const { slots , slotProps } = getSlotsNext(state);\n return /*#__PURE__*/ createElement(ToolbarContext.Provider, {\n value: contextValues.toolbar\n }, /*#__PURE__*/ createElement(slots.root, slotProps.root, slotProps.root.children));\n};\n"],"names":["renderToolbar_unstable","state","contextValues","slots","slotProps","getSlotsNext","createElement","ToolbarContext","Provider","value","toolbar","root","children"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAKjCA;;aAAAA;;iCALkE;gCACtD;gCACE;AAGpB,MAAMA,yBAAyB,CAACC,OAAOC,gBAAgB;IAC9D,MAAM,EAAEC,MAAK,EAAGC,UAAS,EAAG,GAAGC,IAAAA,4BAAY,EAACJ;IAC5C,OAAO,WAAW,GAAGK,IAAAA,8BAAa,EAACC,8BAAc,CAACC,QAAQ,EAAE;QACxDC,OAAOP,cAAcQ,OAAO;IAChC,GAAG,WAAW,GAAGJ,IAAAA,8BAAa,EAACH,MAAMQ,IAAI,EAAEP,UAAUO,IAAI,EAAEP,UAAUO,IAAI,CAACC,QAAQ;AACtF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["useToolbar.js"],"sourcesContent":["import * as React from 'react';\nimport { useEventCallback, useControllableState } from '@fluentui/react-utilities';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\n/**\n * Create the state required to render Toolbar.\n *\n * The returned state can be modified with hooks such as useToolbarStyles_unstable,\n * before being passed to renderToolbar_unstable.\n *\n * @param props - props from this instance of Toolbar\n * @param ref - reference to root HTMLElement of Toolbar\n */ export const useToolbar_unstable = (props, ref)=>{\n const { size ='medium' , vertical =false } = props;\n const arrowNavigationProps = useArrowNavigationGroup({\n circular: true,\n axis: 'both'\n });\n const initialState = {\n size,\n vertical,\n // TODO add appropriate props/defaults\n components: {\n // TODO add each slot's element type or component\n root: 'div'\n },\n // TODO add appropriate slots, for example:\n // mySlot: resolveShorthand(props.mySlot),\n root: getNativeElementProps('div', {\n role: 'toolbar',\n ref,\n ...vertical && {\n 'aria-orientation': 'vertical'\n },\n ...arrowNavigationProps,\n ...props\n })\n };\n const [checkedValues, onCheckedValueChange] = useToolbarSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues: props.defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange\n });\n const handleToggleButton = useEventCallback((e, name, value, checked)=>{\n if (name && value) {\n const checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];\n const newCheckedItems = [\n ...checkedItems\n ];\n if (checked) {\n newCheckedItems.splice(newCheckedItems.indexOf(value), 1);\n } else {\n newCheckedItems.push(value);\n }\n onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {\n name,\n checkedItems: newCheckedItems\n });\n }\n });\n const handleRadio = useEventCallback((e, name, value, checked)=>{\n if (name && value) {\n onCheckedValueChange === null || onCheckedValueChange === void 0 ? void 0 : onCheckedValueChange(e, {\n name,\n checkedItems: [\n value\n ]\n });\n }\n });\n return {\n ...initialState,\n handleToggleButton,\n handleRadio,\n checkedValues: checkedValues !== null && checkedValues !== void 0 ? checkedValues : {}\n };\n};\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */ const useToolbarSelectableState = (state)=>{\n const [checkedValues, setCheckedValues] = useControllableState({\n state: state.checkedValues,\n defaultState: state.defaultCheckedValues,\n initialState: {}\n });\n const { onCheckedValueChange: onCheckedValueChangeOriginal } = state;\n const onCheckedValueChange = useEventCallback((e, { name , checkedItems })=>{\n if (onCheckedValueChangeOriginal) {\n onCheckedValueChangeOriginal(e, {\n name,\n checkedItems\n });\n }\n setCheckedValues((s)=>{\n return s ? {\n ...s,\n [name]: checkedItems\n } : {\n [name]: checkedItems\n };\n });\n });\n return [\n checkedValues,\n onCheckedValueChange\n ];\n};\n"],"names":["useToolbar_unstable","props","ref","size","vertical","arrowNavigationProps","useArrowNavigationGroup","circular","axis","initialState","components","root","getNativeElementProps","role","checkedValues","onCheckedValueChange","useToolbarSelectableState","defaultCheckedValues","handleToggleButton","useEventCallback","e","name","value","checked","checkedItems","newCheckedItems","splice","indexOf","push","handleRadio","state","setCheckedValues","useControllableState","defaultState","onCheckedValueChangeOriginal","s"],"mappings":";;;;+BAYiBA;;aAAAA;;;6DAZM;gCACgC;8BAEf;AAS7B,MAAMA,sBAAsB,CAACC,OAAOC,MAAM;IACjD,MAAM,EAAEC,MAAM,SAAQ,EAAGC,UAAU,KAAK,CAAA,EAAG,GAAGH;IAC9C,MAAMI,uBAAuBC,IAAAA,qCAAuB,EAAC;QACjDC,UAAU,IAAI;QACdC,MAAM;IACV;IACA,MAAMC,eAAe;QACjBN;QACAC;QACA,sCAAsC;QACtCM,YAAY;YACR,iDAAiD;YACjDC,MAAM;QACV;QACA,2CAA2C;QAC3C,0CAA0C;QAC1CA,MAAMC,IAAAA,qCAAqB,EAAC,OAAO;YAC/BC,MAAM;YACNX;YACA,GAAGE,YAAY;gBACX,oBAAoB;YACxB,CAAC;YACD,GAAGC,oBAAoB;YACvB,GAAGJ,KAAK;QACZ;IACJ;IACA,MAAM,CAACa,eAAeC,qBAAqB,GAAGC,0BAA0B;QACpEF,eAAeb,MAAMa,aAAa;QAClCG,sBAAsBhB,MAAMgB,oBAAoB;QAChDF,sBAAsBd,MAAMc,oBAAoB;IACpD;IACA,MAAMG,qBAAqBC,IAAAA,gCAAgB,EAAC,CAACC,GAAGC,MAAMC,OAAOC,UAAU;QACnE,IAAIF,QAAQC,OAAO;YACf,MAAME,eAAe,AAACV,CAAAA,kBAAkB,IAAI,IAAIA,kBAAkB,KAAK,IAAI,KAAK,IAAIA,aAAa,CAACO,KAAK,AAAD,KAAM,EAAE;YAC9G,MAAMI,kBAAkB;mBACjBD;aACN;YACD,IAAID,SAAS;gBACTE,gBAAgBC,MAAM,CAACD,gBAAgBE,OAAO,CAACL,QAAQ;YAC3D,OAAO;gBACHG,gBAAgBG,IAAI,CAACN;YACzB,CAAC;YACDP,yBAAyB,IAAI,IAAIA,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBK,GAAG;gBAChGC;gBACAG,cAAcC;YAClB,EAAE;QACN,CAAC;IACL;IACA,MAAMI,cAAcV,IAAAA,gCAAgB,EAAC,CAACC,GAAGC,MAAMC,OAAOC,UAAU;QAC5D,IAAIF,QAAQC,OAAO;YACfP,yBAAyB,IAAI,IAAIA,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBK,GAAG;gBAChGC;gBACAG,cAAc;oBACVF;iBACH;YACL,EAAE;QACN,CAAC;IACL;IACA,OAAO;QACH,GAAGb,YAAY;QACfS;QACAW;QACAf,eAAeA,kBAAkB,IAAI,IAAIA,kBAAkB,KAAK,IAAIA,gBAAgB,CAAC,CAAC;IAC1F;AACJ;AACA;;;CAGC,GAAG,MAAME,4BAA4B,CAACc,QAAQ;IAC3C,MAAM,CAAChB,eAAeiB,iBAAiB,GAAGC,IAAAA,oCAAoB,EAAC;QAC3DF,OAAOA,MAAMhB,aAAa;QAC1BmB,cAAcH,MAAMb,oBAAoB;QACxCR,cAAc,CAAC;IACnB;IACA,MAAM,EAAEM,sBAAsBmB,6BAA4B,EAAG,GAAGJ;IAChE,MAAMf,uBAAuBI,IAAAA,gCAAgB,EAAC,CAACC,GAAG,EAAEC,KAAI,EAAGG,aAAY,EAAG,GAAG;QACzE,IAAIU,8BAA8B;YAC9BA,6BAA6Bd,GAAG;gBAC5BC;gBACAG;YACJ;QACJ,CAAC;QACDO,iBAAiB,CAACI,IAAI;YAClB,OAAOA,IAAI;gBACP,GAAGA,CAAC;gBACJ,CAACd,KAAK,EAAEG;YACZ,IAAI;gBACA,CAACH,KAAK,EAAEG;YACZ,CAAC;QACL;IACJ;IACA,OAAO;QACHV;QACAC;KACH;AACL"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["useToolbarContextValues.js"],"sourcesContent":["export function useToolbarContextValues_unstable(state) {\n const { size , handleToggleButton , vertical , checkedValues , handleRadio } = state;\n // This context is created with \"@fluentui/react-context-selector\", these is no sense to memoize it\n const toolbar = {\n size,\n vertical,\n handleToggleButton,\n handleRadio,\n checkedValues\n };\n return {\n toolbar\n };\n}\n"],"names":["useToolbarContextValues_unstable","state","size","handleToggleButton","vertical","checkedValues","handleRadio","toolbar"],"mappings":";;;;+BAAgBA;;aAAAA;;AAAT,SAASA,iCAAiCC,KAAK,EAAE;IACpD,MAAM,EAAEC,KAAI,EAAGC,mBAAkB,EAAGC,SAAQ,EAAGC,cAAa,EAAGC,YAAW,EAAG,GAAGL;IAChF,mGAAmG;IACnG,MAAMM,UAAU;QACZL;QACAE;QACAD;QACAG;QACAD;IACJ;IACA,OAAO;QACHE;IACJ;AACJ"}
|
|
@@ -97,5 +97,3 @@ const useToolbarStyles_unstable = (state)=>{
|
|
|
97
97
|
state.root.className = (0, _react.mergeClasses)(toolbarClassNames.root, styles.root, vertical && styles.vertical, size === 'small' && !vertical && styles.small, size === 'medium' && !vertical && styles.medium, size === 'large' && !vertical && styles.large, state.root.className);
|
|
98
98
|
return state;
|
|
99
99
|
}; //# sourceMappingURL=useToolbarStyles.styles.js.map
|
|
100
|
-
|
|
101
|
-
//# sourceMappingURL=useToolbarStyles.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["useToolbarStyles.styles.js"],"sourcesContent":["import { __styles, mergeClasses, shorthands } from '@griffel/react';\nexport const toolbarClassNames = {\n root: 'fui-Toolbar'\n};\n/**\n * Styles for the root slot\n */\nconst useStyles = /*#__PURE__*/__styles({\n root: {\n mc9l5x: \"f22iagw\",\n Bt984gj: \"f122n59\",\n z8tnut: \"f10ra9hq\",\n z189sj: [\"f19lj068\", \"f177v4lu\"],\n Byoj8tv: \"f1y2xyjm\",\n uwmqm3: [\"f177v4lu\", \"f19lj068\"]\n },\n vertical: {\n Beiy3e4: \"f1vx9l62\",\n a9b677: \"f1acs6jw\"\n },\n small: {\n z8tnut: \"f1nbblvp\",\n z189sj: [\"f8wuabp\", \"fycuoez\"],\n Byoj8tv: \"f1ov4xf1\",\n uwmqm3: [\"fycuoez\", \"f8wuabp\"]\n },\n medium: {\n z8tnut: \"f10ra9hq\",\n z189sj: [\"f19lj068\", \"f177v4lu\"],\n Byoj8tv: \"f1y2xyjm\",\n uwmqm3: [\"f177v4lu\", \"f19lj068\"]\n },\n large: {\n z8tnut: \"f10ra9hq\",\n z189sj: [\"fat0sn4\", \"fekwl8i\"],\n Byoj8tv: \"f1y2xyjm\",\n uwmqm3: [\"fekwl8i\", \"fat0sn4\"]\n }\n}, {\n d: [\".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}\", \".f10ra9hq{padding-top:4px;}\", \".f19lj068{padding-right:8px;}\", \".f177v4lu{padding-left:8px;}\", \".f1y2xyjm{padding-bottom:4px;}\", \".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}\", \".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}\", \".f1nbblvp{padding-top:0px;}\", \".f8wuabp{padding-right:4px;}\", \".fycuoez{padding-left:4px;}\", \".f1ov4xf1{padding-bottom:0px;}\", \".fat0sn4{padding-right:20px;}\", \".fekwl8i{padding-left:20px;}\"]\n});\n/**\n * Apply styling to the Toolbar slots based on the state\n */\nexport const useToolbarStyles_unstable = state => {\n const styles = useStyles();\n const {\n vertical,\n size\n } = state;\n state.root.className = mergeClasses(toolbarClassNames.root, styles.root, vertical && styles.vertical, size === 'small' && !vertical && styles.small, size === 'medium' && !vertical && styles.medium, size === 'large' && !vertical && styles.large, state.root.className);\n return state;\n};\n//# sourceMappingURL=useToolbarStyles.styles.js.map"],"names":["toolbarClassNames","useToolbarStyles_unstable","root","useStyles","__styles","mc9l5x","Bt984gj","z8tnut","z189sj","Byoj8tv","uwmqm3","vertical","Beiy3e4","a9b677","small","medium","large","d","state","styles","size","className","mergeClasses"],"mappings":";;;;;;;;;;;IACaA,iBAAiB,MAAjBA;IA2CAC,yBAAyB,MAAzBA;;uBA5CsC;AAC5C,MAAMD,oBAAoB;IAC/BE,MAAM;AACR;AACA;;CAEC,GACD,MAAMC,YAAY,WAAW,GAAEC,IAAAA,kBAAQ,EAAC;IACtCF,MAAM;QACJG,QAAQ;QACRC,SAAS;QACTC,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;IAClC;IACAC,UAAU;QACRC,SAAS;QACTC,QAAQ;IACV;IACAC,OAAO;QACLP,QAAQ;QACRC,QAAQ;YAAC;YAAW;SAAU;QAC9BC,SAAS;QACTC,QAAQ;YAAC;YAAW;SAAU;IAChC;IACAK,QAAQ;QACNR,QAAQ;QACRC,QAAQ;YAAC;YAAY;SAAW;QAChCC,SAAS;QACTC,QAAQ;YAAC;YAAY;SAAW;IAClC;IACAM,OAAO;QACLT,QAAQ;QACRC,QAAQ;YAAC;YAAW;SAAU;QAC9BC,SAAS;QACTC,QAAQ;YAAC;YAAW;SAAU;IAChC;AACF,GAAG;IACDO,GAAG;QAAC;QAAwF;QAA2G;QAA+B;QAAiC;QAAgC;QAAkC;QAA6F;QAAkF;QAA+B;QAAgC;QAA+B;QAAkC;QAAiC;KAA+B;AAC1rB;AAIO,MAAMhB,4BAA4BiB,CAAAA,QAAS;IAChD,MAAMC,SAAShB;IACf,MAAM,EACJQ,SAAQ,EACRS,KAAI,EACL,GAAGF;IACJA,MAAMhB,IAAI,CAACmB,SAAS,GAAGC,IAAAA,mBAAY,EAACtB,kBAAkBE,IAAI,EAAEiB,OAAOjB,IAAI,EAAES,YAAYQ,OAAOR,QAAQ,EAAES,SAAS,WAAW,CAACT,YAAYQ,OAAOL,KAAK,EAAEM,SAAS,YAAY,CAACT,YAAYQ,OAAOJ,MAAM,EAAEK,SAAS,WAAW,CAACT,YAAYQ,OAAOH,KAAK,EAAEE,MAAMhB,IAAI,CAACmB,SAAS;IACzQ,OAAOH;AACT,GACA,mDAAmD"}
|
|
@@ -19,6 +19,4 @@ const ToolbarButton = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
19
19
|
return (0, _reactButton.renderButton_unstable)(state);
|
|
20
20
|
// Casting is required due to lack of distributive union to support unions on @types/react
|
|
21
21
|
});
|
|
22
|
-
ToolbarButton.displayName = 'ToolbarButton';
|
|
23
|
-
|
|
24
|
-
//# sourceMappingURL=ToolbarButton.js.map
|
|
22
|
+
ToolbarButton.displayName = 'ToolbarButton';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["ToolbarButton.js"],"sourcesContent":["import * as React from 'react';\nimport { renderButton_unstable } from '@fluentui/react-button';\nimport { useToolbarButtonStyles_unstable } from './useToolbarButtonStyles.styles';\nimport { useToolbarButton_unstable } from './useToolbarButton';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * ToolbarButton component is a Button to be used inside Toolbar\n * which will respect toolbar props such as `size`\n */ export const ToolbarButton = /*#__PURE__*/ React.forwardRef((props, ref)=>{\n const state = useToolbarButton_unstable(props, ref);\n useToolbarButtonStyles_unstable(state);\n useCustomStyleHook_unstable('useToolbarButtonStyles_unstable')(state);\n return renderButton_unstable(state);\n// Casting is required due to lack of distributive union to support unions on @types/react\n});\nToolbarButton.displayName = 'ToolbarButton';\n"],"names":["ToolbarButton","React","forwardRef","props","ref","state","useToolbarButton_unstable","useToolbarButtonStyles_unstable","useCustomStyleHook_unstable","renderButton_unstable","displayName"],"mappings":";;;;+BAQiBA;;aAAAA;;;6DARM;6BACe;8CACU;kCACN;qCACE;AAIjC,MAAMA,gBAAgB,WAAW,GAAGC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAM;IAC1E,MAAMC,QAAQC,IAAAA,2CAAyB,EAACH,OAAOC;IAC/CG,IAAAA,6DAA+B,EAACF;IAChCG,IAAAA,gDAA2B,EAAC,mCAAmCH;IAC/D,OAAOI,IAAAA,kCAAqB,EAACJ;AACjC,0FAA0F;AAC1F;AACAL,cAAcU,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|