@fluentui/react-toolbar 9.74.9-experimental.menu-disable-autofocus.20261008-e9914a95c6.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 +37 -13
- 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 +15 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,25 +1,49 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-toolbar
|
|
2
2
|
|
|
3
|
-
<!-- This log was last generated on
|
|
3
|
+
<!-- This log was last generated on Sat, 31 Oct 2026 11:08:40 GMT and should not be manually modified. -->
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [9.
|
|
7
|
+
## [9.75.0-experimental.css-modules.20261031-810ab07afb.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Sat, 31 Oct 2026 11:08:40 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.8.7..@fluentui/react-toolbar_v9.75.0-experimental.css-modules.20261031-810ab07afb.0)
|
|
10
11
|
|
|
11
12
|
### Changes
|
|
12
13
|
|
|
13
|
-
- Release 9.
|
|
14
|
-
- Bump @fluentui/react-button to v9.
|
|
15
|
-
- Bump @fluentui/react-context-selector to v9.
|
|
16
|
-
- Bump @fluentui/react-divider to v9.
|
|
17
|
-
- Bump @fluentui/react-jsx-runtime to v9.
|
|
18
|
-
- Bump @fluentui/react-radio to v9.
|
|
19
|
-
- Bump @fluentui/react-shared-contexts to v9.
|
|
20
|
-
- Bump @fluentui/react-tabster to v9.
|
|
21
|
-
- Bump @fluentui/react-theme to v9.
|
|
22
|
-
- Bump @fluentui/react-utilities to v9.
|
|
14
|
+
- Release 9.75.0-experimental.css-modules.20261031-810ab07afb ([commit](https://github.com/microsoft/fluentui/commit/undefined) by 257645319+office-ogx-auth-helper[bot]@users.noreply.github.com)
|
|
15
|
+
- Bump @fluentui/react-button to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
16
|
+
- Bump @fluentui/react-context-selector to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
17
|
+
- Bump @fluentui/react-divider to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
18
|
+
- Bump @fluentui/react-jsx-runtime to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
19
|
+
- Bump @fluentui/react-radio to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
20
|
+
- Bump @fluentui/react-shared-contexts to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tabster to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
22
|
+
- Bump @fluentui/react-theme to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
23
|
+
- Bump @fluentui/react-utilities to v9.75.0-experimental.css-modules.20261031-810ab07afb.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
24
|
+
|
|
25
|
+
## [9.8.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.8.7)
|
|
26
|
+
|
|
27
|
+
Thu, 22 Oct 2026 11:25:58 GMT
|
|
28
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.8.6..@fluentui/react-toolbar_v9.8.7)
|
|
29
|
+
|
|
30
|
+
### Patches
|
|
31
|
+
|
|
32
|
+
- Bump @fluentui/react-button to v9.11.3 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
33
|
+
|
|
34
|
+
## [9.8.6](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.8.6)
|
|
35
|
+
|
|
36
|
+
Mon, 19 Oct 2026 16:49:01 GMT
|
|
37
|
+
|
|
38
|
+
### Patches
|
|
39
|
+
|
|
40
|
+
- Bump @fluentui/react-button to v9.11.2 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
41
|
+
- Bump @fluentui/react-context-selector to v9.2.21 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
42
|
+
- Bump @fluentui/react-divider to v9.7.6 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
43
|
+
- Bump @fluentui/react-jsx-runtime to v9.4.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
44
|
+
- Bump @fluentui/react-radio to v9.6.7 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
45
|
+
- Bump @fluentui/react-tabster to v9.26.19 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
46
|
+
- Bump @fluentui/react-utilities to v9.27.0 ([commit](https://github.com/microsoft/fluentui/commit/undefined) by beachball)
|
|
23
47
|
|
|
24
48
|
## [9.8.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.8.5)
|
|
25
49
|
|
package/README.md
CHANGED
|
@@ -5,3 +5,15 @@
|
|
|
5
5
|
**React Toolbar components for [Fluent UI React](https://react.fluentui.dev)**
|
|
6
6
|
|
|
7
7
|
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.
|
|
8
|
+
|
|
9
|
+
## Opt-in CSS Modules styles
|
|
10
|
+
|
|
11
|
+
Toolbar, ToolbarGroup, ToolbarButton, ToolbarDivider, ToolbarRadioButton, and ToolbarToggleButton have alternatives. The composed controls continue calling the public Button, ToggleButton, or Divider style hooks; select those packages’ CSS Modules alternatives with the same resolver so each public hook is replaced wholesale.
|
|
12
|
+
|
|
13
|
+
The default components continue to use Griffel. An opt-in bundler resolver can replace
|
|
14
|
+
`use<Component>Styles.styles.js` with `use<Component>Styles.styles.css.js`
|
|
15
|
+
(and the corresponding `.ts` source modules). Keep the emitted CSS assets and process
|
|
16
|
+
their CSS Modules imports; all rules are in `@layer fluentui`. Apply the same selection
|
|
17
|
+
to client and server bundles. Within-package composed alternatives import their CSS
|
|
18
|
+
base hook explicitly. These alternatives do not make composed external components
|
|
19
|
+
Griffel-free. Browser, forced-colors, SSR, and full VRT parity require separate validation.
|
|
@@ -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;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,mBAAmB,QAAQ,kBAAe;AACnD,SAASC,sBAAsB,QAAQ,qBAAkB;AACzD,SAASC,yBAAyB,QAAQ,+BAA4B;AAGtE,SAASC,gCAAgC,QAAQ,+BAA4B;AAC7E,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,wBAA6CN,MAAMO,UAAU,CAAC,CAACC,OAAOC;IACjF,MAAMC,QAAQT,oBAAoBO,OAAOC;IACzC,MAAME,gBAAgBP,iCAAiCM;IAEvDP,0BAA0BO;IAE1BL,4BAA4B,6BAA6BK;IAEzD,OAAOR,uBAAuBQ,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":"AAqFA,WAKU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/ToolbarContext.ts"],"sourcesContent":["'use client';\n\nimport { createContext, useContextSelector } from '@fluentui/react-context-selector';\nimport type { Context, ContextSelector } from '@fluentui/react-context-selector';\nimport type { ToolbarContextValue } from './Toolbar.types';\n\nexport const ToolbarContext = createContext<ToolbarContextValue | undefined>(undefined) as Context<ToolbarContextValue>;\n\nconst toolbarContextDefaultValue: ToolbarContextValue = {\n size: 'medium' as 'medium',\n handleToggleButton: () => null,\n handleRadio: () => null,\n vertical: false,\n checkedValues: {},\n};\n\nexport const useToolbarContext_unstable = <T>(selector: ContextSelector<ToolbarContextValue, T>): T =>\n useContextSelector(ToolbarContext, (ctx = toolbarContextDefaultValue) => selector(ctx));\n"],"names":["createContext","useContextSelector","ToolbarContext","undefined","toolbarContextDefaultValue","size","handleToggleButton","handleRadio","vertical","checkedValues","useToolbarContext_unstable","selector","ctx"],"mappings":"AAAA;AAEA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,mCAAmC;AAIrF,OAAO,MAAMC,iBAAiBF,cAA+CG,WAA2C;AAExH,MAAMC,6BAAkD;IACtDC,MAAM;IACNC,oBAAoB,IAAM;IAC1BC,aAAa,IAAM;IACnBC,UAAU;IACVC,eAAe,CAAC;AAClB;AAEA,OAAO,MAAMC,6BAA6B,CAAIC,WAC5CV,mBAAmBC,gBAAgB,CAACU,MAAMR,0BAA0B,GAAKO,SAASC,MAAM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/index.ts"],"sourcesContent":["export { useToolbarContext_unstable } from './ToolbarContext';\nexport { Toolbar } from './Toolbar';\nexport 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 './Toolbar.types';\nexport { renderToolbar_unstable } from './renderToolbar';\nexport { useToolbar_unstable, useToolbarBase_unstable } from './useToolbar';\nexport { useToolbarContextValues_unstable } from './useToolbarContextValues';\nexport { toolbarClassNames, useToolbarStyles_unstable } from './useToolbarStyles.styles';\n"],"names":["useToolbarContext_unstable","Toolbar","renderToolbar_unstable","useToolbar_unstable","useToolbarBase_unstable","useToolbarContextValues_unstable","toolbarClassNames","useToolbarStyles_unstable"],"mappings":"AAAA,SAASA,0BAA0B,QAAQ,sBAAmB;AAC9D,SAASC,OAAO,QAAQ,eAAY;AAcpC,SAASC,sBAAsB,QAAQ,qBAAkB;AACzD,SAASC,mBAAmB,EAAEC,uBAAuB,QAAQ,kBAAe;AAC5E,SAASC,gCAAgC,QAAQ,+BAA4B;AAC7E,SAASC,iBAAiB,EAAEC,yBAAyB,QAAQ,+BAA4B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { assertSlots } from "@fluentui/react-utilities";
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
import { ToolbarContext } from "./ToolbarContext.js";
|
|
4
4
|
/**
|
|
5
5
|
* Render the final JSX of Toolbar
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/renderToolbar.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { ToolbarBaseState, ToolbarSlots, ToolbarContextValues } from './Toolbar.types';\nimport { ToolbarContext } from './ToolbarContext';\n\n/**\n * Render the final JSX of Toolbar\n */\nexport const renderToolbar_unstable = (state: ToolbarBaseState, contextValues: ToolbarContextValues): JSXElement => {\n assertSlots<ToolbarSlots>(state);\n\n return (\n <ToolbarContext.Provider value={contextValues.toolbar}>\n <state.root>{state.root.children}</state.root>\n </ToolbarContext.Provider>\n );\n};\n"],"names":["assertSlots","ToolbarContext","renderToolbar_unstable","state","contextValues","Provider","value","toolbar","root","children"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GACjD,SAASA,WAAW,QAAQ,4BAA4B;AAGxD,SAASC,cAAc,QAAQ,sBAAmB;AAElD;;CAEC,GACD,OAAO,MAAMC,yBAAyB,CAACC,OAAyBC;IAC9DJ,YAA0BG;IAE1B,qBACE,KAACF,eAAeI,QAAQ;QAACC,OAAOF,cAAcG,OAAO;kBACnD,cAAA,KAACJ,MAAMK,IAAI;sBAAEL,MAAMK,IAAI,CAACC,QAAQ;;;AAGtC,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/useToolbar.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useEventCallback, useControllableState, getIntrinsicElementProps, slot } from '@fluentui/react-utilities';\nimport type {\n ToggableHandler,\n ToolbarBaseProps,\n ToolbarBaseState,\n ToolbarProps,\n ToolbarState,\n UninitializedToolbarState,\n} from './Toolbar.types';\nimport type { TabsterDOMAttribute } from '@fluentui/react-tabster';\nimport { useArrowNavigationGroup } from '@fluentui/react-tabster';\n\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 */\nexport const useToolbar_unstable = (props: ToolbarProps, ref: React.Ref<HTMLElement>): ToolbarState => {\n const { size = 'medium' } = props;\n const state = useToolbarBase_unstable(props, ref);\n const arrowNavigationProps = useToolbarArrowNavigationProps_unstable();\n\n return {\n size,\n ...state,\n root: {\n ...state.root,\n ...arrowNavigationProps,\n },\n };\n};\n\n/**\n * Base hook that builds Toolbar state for behavior and structure only.\n * It does not add arrow key navigation, which is handled by `useToolbar_unstable`.\n *\n * @internal\n * @param props - Props for this Toolbar instance.\n * @param ref - Ref to the root HTMLElement.\n */\nexport const useToolbarBase_unstable = (props: ToolbarBaseProps, ref: React.Ref<HTMLElement>): ToolbarBaseState => {\n const { vertical = false } = props;\n\n const initialState: UninitializedToolbarState = {\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: slot.always(\n getIntrinsicElementProps('div', {\n role: 'toolbar',\n ref: ref as React.Ref<HTMLDivElement>,\n ...(vertical && ({ 'aria-orientation': 'vertical' } as const)),\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n\n const [checkedValues, onCheckedValueChange] = useToolbarSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues: props.defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange,\n });\n\n const handleToggleButton: ToggableHandler = useEventCallback(\n (e: React.MouseEvent | React.KeyboardEvent, name: string, value: string, checked?: boolean) => {\n if (name && value) {\n const checkedItems = checkedValues?.[name] || [];\n const newCheckedItems = [...checkedItems];\n if (checked) {\n newCheckedItems.splice(newCheckedItems.indexOf(value), 1);\n } else {\n newCheckedItems.push(value);\n }\n onCheckedValueChange?.(e, { name, checkedItems: newCheckedItems });\n }\n },\n );\n\n const handleRadio: ToggableHandler = useEventCallback(\n (e: React.MouseEvent | React.KeyboardEvent, name: string, value: string, checked?: boolean) => {\n if (name && value) {\n onCheckedValueChange?.(e, {\n name,\n checkedItems: [value],\n });\n }\n },\n );\n\n return {\n ...initialState,\n handleToggleButton,\n handleRadio,\n checkedValues: checkedValues ?? {},\n };\n};\n\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */\nconst useToolbarSelectableState = (\n state: Pick<ToolbarBaseProps, 'checkedValues' | 'defaultCheckedValues' | 'onCheckedValueChange'>,\n) => {\n const [checkedValues, setCheckedValues] = useControllableState({\n state: state.checkedValues,\n defaultState: state.defaultCheckedValues,\n initialState: {},\n });\n const { onCheckedValueChange: onCheckedValueChangeOriginal } = state;\n const onCheckedValueChange: ToolbarBaseState['onCheckedValueChange'] = useEventCallback(\n (e, { name, checkedItems }) => {\n if (onCheckedValueChangeOriginal) {\n onCheckedValueChangeOriginal(e, { name, checkedItems });\n }\n\n setCheckedValues(s => {\n return s ? { ...s, [name]: checkedItems } : { [name]: checkedItems };\n });\n },\n );\n\n return [checkedValues, onCheckedValueChange] as const;\n};\n\n/**\n * Hook to add arrow navigation props to the Toolbar.\n *\n * @internal\n * @returns - Tabster DOM attributes for arrow navigation\n */\nexport const useToolbarArrowNavigationProps_unstable = (): TabsterDOMAttribute => {\n return useArrowNavigationGroup({\n circular: true,\n axis: 'both',\n });\n};\n"],"names":["useEventCallback","useControllableState","getIntrinsicElementProps","slot","useArrowNavigationGroup","useToolbar_unstable","props","ref","size","state","useToolbarBase_unstable","arrowNavigationProps","useToolbarArrowNavigationProps_unstable","root","vertical","initialState","components","always","role","elementType","checkedValues","onCheckedValueChange","useToolbarSelectableState","defaultCheckedValues","handleToggleButton","e","name","value","checked","checkedItems","newCheckedItems","splice","indexOf","push","handleRadio","setCheckedValues","defaultState","onCheckedValueChangeOriginal","s","circular","axis"],"mappings":"AAAA;AAGA,SAASA,gBAAgB,EAAEC,oBAAoB,EAAEC,wBAAwB,EAAEC,IAAI,QAAQ,4BAA4B;AAUnH,SAASC,uBAAuB,QAAQ,0BAA0B;AAElE;;;;;;;;CAQC,GACD,OAAO,MAAMC,sBAAsB,CAACC,OAAqBC;IACvD,MAAM,EAAEC,OAAO,QAAQ,EAAE,GAAGF;IAC5B,MAAMG,QAAQC,wBAAwBJ,OAAOC;IAC7C,MAAMI,uBAAuBC;IAE7B,OAAO;QACLJ;QACA,GAAGC,KAAK;QACRI,MAAM;YACJ,GAAGJ,MAAMI,IAAI;YACb,GAAGF,oBAAoB;QACzB;IACF;AACF,EAAE;AAEF;;;;;;;CAOC,GACD,OAAO,MAAMD,0BAA0B,CAACJ,OAAyBC;IAC/D,MAAM,EAAEO,WAAW,KAAK,EAAE,GAAGR;IAE7B,MAAMS,eAA0C;QAC9CD;QACA,sCAAsC;QACtCE,YAAY;YACV,iDAAiD;YACjDH,MAAM;QACR;QACA,2CAA2C;QAC3C,0CAA0C;QAC1CA,MAAMV,KAAKc,MAAM,CACff,yBAAyB,OAAO;YAC9BgB,MAAM;YACNX,KAAKA;YACL,GAAIO,YAAa;gBAAE,oBAAoB;YAAW,CAAW;YAC7D,GAAGR,KAAK;QACV,IACA;YAAEa,aAAa;QAAM;IAEzB;IAEA,MAAM,CAACC,eAAeC,qBAAqB,GAAGC,0BAA0B;QACtEF,eAAed,MAAMc,aAAa;QAClCG,sBAAsBjB,MAAMiB,oBAAoB;QAChDF,sBAAsBf,MAAMe,oBAAoB;IAClD;IAEA,MAAMG,qBAAsCxB,iBAC1C,CAACyB,GAA2CC,MAAcC,OAAeC;QACvE,IAAIF,QAAQC,OAAO;YACjB,MAAME,eAAeT,CAAAA,0BAAAA,oCAAAA,aAAe,CAACM,KAAK,KAAI,EAAE;YAChD,MAAMI,kBAAkB;mBAAID;aAAa;YACzC,IAAID,SAAS;gBACXE,gBAAgBC,MAAM,CAACD,gBAAgBE,OAAO,CAACL,QAAQ;YACzD,OAAO;gBACLG,gBAAgBG,IAAI,CAACN;YACvB;YACAN,iCAAAA,2CAAAA,qBAAuBI,GAAG;gBAAEC;gBAAMG,cAAcC;YAAgB;QAClE;IACF;IAGF,MAAMI,cAA+BlC,iBACnC,CAACyB,GAA2CC,MAAcC,OAAeC;QACvE,IAAIF,QAAQC,OAAO;YACjBN,iCAAAA,2CAAAA,qBAAuBI,GAAG;gBACxBC;gBACAG,cAAc;oBAACF;iBAAM;YACvB;QACF;IACF;IAGF,OAAO;QACL,GAAGZ,YAAY;QACfS;QACAU;QACAd,aAAa,EAAEA,0BAAAA,2BAAAA,gBAAiB,CAAC;IACnC;AACF,EAAE;AAEF;;;CAGC,GACD,MAAME,4BAA4B,CAChCb;IAEA,MAAM,CAACW,eAAee,iBAAiB,GAAGlC,qBAAqB;QAC7DQ,OAAOA,MAAMW,aAAa;QAC1BgB,cAAc3B,MAAMc,oBAAoB;QACxCR,cAAc,CAAC;IACjB;IACA,MAAM,EAAEM,sBAAsBgB,4BAA4B,EAAE,GAAG5B;IAC/D,MAAMY,uBAAiErB,iBACrE,CAACyB,GAAG,EAAEC,IAAI,EAAEG,YAAY,EAAE;QACxB,IAAIQ,8BAA8B;YAChCA,6BAA6BZ,GAAG;gBAAEC;gBAAMG;YAAa;QACvD;QAEAM,iBAAiBG,CAAAA;YACf,OAAOA,IAAI;gBAAE,GAAGA,CAAC;gBAAE,CAACZ,KAAK,EAAEG;YAAa,IAAI;gBAAE,CAACH,KAAK,EAAEG;YAAa;QACrE;IACF;IAGF,OAAO;QAACT;QAAeC;KAAqB;AAC9C;AAEA;;;;;CAKC,GACD,OAAO,MAAMT,0CAA0C;IACrD,OAAOR,wBAAwB;QAC7BmC,UAAU;QACVC,MAAM;IACR;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/useToolbarContextValues.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ToolbarContextValue, ToolbarContextValues, ToolbarState } from './Toolbar.types';\n\nexport function useToolbarContextValues_unstable(state: ToolbarState): ToolbarContextValues {\n const { size, handleToggleButton, vertical, checkedValues, handleRadio } = state;\n\n const toolbar = React.useMemo<ToolbarContextValue>(\n () => ({\n size,\n vertical,\n handleToggleButton,\n handleRadio,\n checkedValues,\n }),\n [size, vertical, handleToggleButton, handleRadio, checkedValues],\n );\n\n return { toolbar };\n}\n"],"names":["React","useToolbarContextValues_unstable","state","size","handleToggleButton","vertical","checkedValues","handleRadio","toolbar","useMemo"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,OAAO,SAASC,iCAAiCC,KAAmB;IAClE,MAAM,EAAEC,IAAI,EAAEC,kBAAkB,EAAEC,QAAQ,EAAEC,aAAa,EAAEC,WAAW,EAAE,GAAGL;IAE3E,MAAMM,UAAUR,MAAMS,OAAO,CAC3B,IAAO,CAAA;YACLN;YACAE;YACAD;YACAG;YACAD;QACF,CAAA,GACA;QAACH;QAAME;QAAUD;QAAoBG;QAAaD;KAAc;IAGlE,OAAO;QAAEE;IAAQ;AACnB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Toolbar.module.css";
|
|
3
|
+
export const toolbarClassNames = {
|
|
4
|
+
root: 'fui-Toolbar'
|
|
5
|
+
};
|
|
6
|
+
export const useToolbarStyles_unstable = (state)=>{
|
|
7
|
+
state.root.className = clsx(toolbarClassNames.root, styles.root, state.vertical && styles.vertical, styles[state.size], state.root.className);
|
|
8
|
+
return state;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/useToolbarStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ToolbarState, ToolbarSlots } from './Toolbar.types';\nimport styles from './Toolbar.module.css';\n\nexport const toolbarClassNames: SlotClassNames<ToolbarSlots> = {\n root: 'fui-Toolbar',\n};\n\nexport const useToolbarStyles_unstable = (state: ToolbarState): ToolbarState => {\n state.root.className = clsx(\n toolbarClassNames.root,\n styles.root,\n state.vertical && styles.vertical,\n styles[state.size],\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","toolbarClassNames","root","useToolbarStyles_unstable","state","className","vertical","size"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,uBAAuB;AAE1C,OAAO,MAAMC,oBAAkD;IAC7DC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,4BAA4B,CAACC;IACxCA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,kBAAkBC,IAAI,EACtBF,OAAOE,IAAI,EACXE,MAAME,QAAQ,IAAIN,OAAOM,QAAQ,EACjCN,MAAM,CAACI,MAAMG,IAAI,CAAC,EAClBH,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { clsx } from "clsx";
|
|
2
|
+
import styles from "./Toolbar.module.css";
|
|
3
|
+
export const toolbarClassNames = {
|
|
4
|
+
root: 'fui-Toolbar'
|
|
5
|
+
};
|
|
6
|
+
export const useToolbarStyles_unstable = (state)=>{
|
|
7
|
+
state.root.className = clsx(toolbarClassNames.root, styles.root, state.vertical && styles.vertical, styles[state.size], state.root.className);
|
|
8
|
+
return state;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/useToolbarStyles.styles.css.ts"],"sourcesContent":["import { clsx } from 'clsx';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { ToolbarState, ToolbarSlots } from './Toolbar.types';\nimport styles from './Toolbar.module.css';\n\nexport const toolbarClassNames: SlotClassNames<ToolbarSlots> = {\n root: 'fui-Toolbar',\n};\n\nexport const useToolbarStyles_unstable = (state: ToolbarState): ToolbarState => {\n state.root.className = clsx(\n toolbarClassNames.root,\n styles.root,\n state.vertical && styles.vertical,\n styles[state.size],\n state.root.className,\n );\n return state;\n};\n"],"names":["clsx","styles","toolbarClassNames","root","useToolbarStyles_unstable","state","className","vertical","size"],"mappings":"AAAA,SAASA,IAAI,QAAQ,OAAO;AAG5B,OAAOC,YAAY,uBAAuB;AAE1C,OAAO,MAAMC,oBAAkD;IAC7DC,MAAM;AACR,EAAE;AAEF,OAAO,MAAMC,4BAA4B,CAACC;IACxCA,MAAMF,IAAI,CAACG,SAAS,GAAGN,KACrBE,kBAAkBC,IAAI,EACtBF,OAAOE,IAAI,EACXE,MAAME,QAAQ,IAAIN,OAAOM,QAAQ,EACjCN,MAAM,CAACI,MAAMG,IAAI,CAAC,EAClBH,MAAMF,IAAI,CAACG,SAAS;IAEtB,OAAOD;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Toolbar/useToolbarStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { ToolbarSlots, ToolbarState } from './Toolbar.types';\n\nexport const toolbarClassNames: SlotClassNames<ToolbarSlots> = {\n root: 'fui-Toolbar',\n};\n\n/**\n * Styles for the root slot\n */\nconst useStyles = makeStyles({\n root: {\n display: 'flex',\n alignItems: 'center',\n padding: '4px 8px',\n },\n vertical: {\n flexDirection: 'column',\n width: 'fit-content',\n },\n small: { padding: '0px 4px' },\n medium: { padding: '4px 8px' },\n large: { padding: '4px 20px' },\n});\n\n/**\n * Apply styling to the Toolbar slots based on the state\n */\nexport const useToolbarStyles_unstable = (state: ToolbarState): ToolbarState => {\n const styles = useStyles();\n const { vertical, size } = state;\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n toolbarClassNames.root,\n styles.root,\n vertical && styles.vertical,\n size === 'small' && !vertical && styles.small,\n size === 'medium' && !vertical && styles.medium,\n size === 'large' && !vertical && styles.large,\n state.root.className,\n );\n\n return state;\n};\n"],"names":["makeStyles","mergeClasses","toolbarClassNames","root","useStyles","display","alignItems","padding","vertical","flexDirection","width","small","medium","large","useToolbarStyles_unstable","state","styles","size","className"],"mappings":"AAAA;AAGA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAG1D,OAAO,MAAMC,oBAAkD;IAC7DC,MAAM;AACR,EAAE;AAEF;;CAEC,GACD,MAAMC,YAAYJ,WAAW;IAC3BG,MAAM;QACJE,SAAS;QACTC,YAAY;QACZC,SAAS;IACX;IACAC,UAAU;QACRC,eAAe;QACfC,OAAO;IACT;IACAC,OAAO;QAAEJ,SAAS;IAAU;IAC5BK,QAAQ;QAAEL,SAAS;IAAU;IAC7BM,OAAO;QAAEN,SAAS;IAAW;AAC/B;AAEA;;CAEC,GACD,OAAO,MAAMO,4BAA4B,CAACC;IACxC,MAAMC,SAASZ;IACf,MAAM,EAAEI,QAAQ,EAAES,IAAI,EAAE,GAAGF;IAC3B,oDAAoD;IACpDA,MAAMZ,IAAI,CAACe,SAAS,GAAGjB,aACrBC,kBAAkBC,IAAI,EACtBa,OAAOb,IAAI,EACXK,YAAYQ,OAAOR,QAAQ,EAC3BS,SAAS,WAAW,CAACT,YAAYQ,OAAOL,KAAK,EAC7CM,SAAS,YAAY,CAACT,YAAYQ,OAAOJ,MAAM,EAC/CK,SAAS,WAAW,CAACT,YAAYQ,OAAOH,KAAK,EAC7CE,MAAMZ,IAAI,CAACe,SAAS;IAGtB,OAAOH;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarButton/ToolbarButton.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ToolbarButtonProps } from './ToolbarButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\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/**\n * ToolbarButton component is a Button to be used inside Toolbar\n * which will respect toolbar props such as `size`\n */\nexport const ToolbarButton: ForwardRefComponent<ToolbarButtonProps> = React.forwardRef((props, ref) => {\n const state = useToolbarButton_unstable(props, ref);\n\n useToolbarButtonStyles_unstable(state);\n\n useCustomStyleHook_unstable('useToolbarButtonStyles_unstable')(state);\n\n return renderButton_unstable(state);\n // Casting is required due to lack of distributive union to support unions on @types/react\n}) as ForwardRefComponent<ToolbarButtonProps>;\n\nToolbarButton.displayName = 'ToolbarButton';\n"],"names":["React","renderButton_unstable","useToolbarButtonStyles_unstable","useToolbarButton_unstable","useCustomStyleHook_unstable","ToolbarButton","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,+BAA+B,QAAQ,qCAAkC;AAClF,SAASC,yBAAyB,QAAQ,wBAAqB;AAC/D,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,8BAAyDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC7F,MAAMC,QAAQN,0BAA0BI,OAAOC;IAE/CN,gCAAgCO;IAEhCL,4BAA4B,mCAAmCK;IAE/D,OAAOR,sBAAsBQ;AAC7B,0FAA0F;AAC5F,GAA8C;AAE9CJ,cAAcK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarButton/ToolbarButton.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, DistributiveOmit } from '@fluentui/react-utilities';\nimport type { ButtonProps, ButtonSlots, ButtonState } from '@fluentui/react-button';\n\n/**\n * ToolbarButton Props\n */\nexport type ToolbarButtonProps = ComponentProps<ButtonSlots> &\n Partial<Pick<ButtonProps, 'disabled' | 'disabledFocusable'>> & {\n appearance?: 'primary' | 'subtle' | 'transparent';\n } & {\n vertical?: boolean;\n };\n\nexport type ToolbarButtonBaseProps = DistributiveOmit<ToolbarButtonProps, 'appearance'>;\n\n/**\n * State used in rendering ToolbarButton\n */\nexport type ToolbarButtonState = ComponentState<Partial<ButtonSlots>> &\n ButtonState &\n Required<Pick<ToolbarButtonProps, 'vertical'>>;\n\nexport type ToolbarButtonBaseState = DistributiveOmit<ToolbarButtonState, 'appearance' | 'size' | 'shape'>;\n"],"names":[],"mappings":"AAsBA,WAA2G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarButton/index.ts"],"sourcesContent":["export { ToolbarButton } from './ToolbarButton';\nexport type {\n ToolbarButtonBaseProps,\n ToolbarButtonProps,\n ToolbarButtonBaseState,\n ToolbarButtonState,\n} from './ToolbarButton.types';\nexport { useToolbarButton_unstable, useToolbarButtonBase_unstable } from './useToolbarButton';\nexport { useToolbarButtonStyles_unstable } from './useToolbarButtonStyles.styles';\n"],"names":["ToolbarButton","useToolbarButton_unstable","useToolbarButtonBase_unstable","useToolbarButtonStyles_unstable"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAkB;AAOhD,SAASC,yBAAyB,EAAEC,6BAA6B,QAAQ,wBAAqB;AAC9F,SAASC,+BAA+B,QAAQ,qCAAkC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarButton/useToolbarButton.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport { useButtonBase_unstable } from '@fluentui/react-button';\nimport type {\n ToolbarButtonBaseProps,\n ToolbarButtonBaseState,\n ToolbarButtonProps,\n ToolbarButtonState,\n} from './ToolbarButton.types';\n\n/**\n * Given user props, defines default props for the Button, calls useButtonState and useChecked, and returns\n * processed state.\n * @param props - User provided props to the Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useToolbarButton_unstable = (\n props: ToolbarButtonProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToolbarButtonState => {\n const { appearance = 'subtle', ...baseProps } = props;\n const state = useToolbarButtonBase_unstable(baseProps, ref);\n\n return {\n appearance,\n size: 'medium',\n shape: 'rounded',\n ...state,\n };\n};\n\n/**\n * Base hook that builds Toolbar Button 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 Button component.\n * @param ref - User provided ref to be passed to the Button component.\n */\nexport const useToolbarButtonBase_unstable = (\n props: ToolbarButtonBaseProps,\n ref: React.Ref<HTMLButtonElement | HTMLAnchorElement>,\n): ToolbarButtonBaseState => {\n const { vertical = false, ...buttonProps } = props;\n const state = useButtonBase_unstable(buttonProps, ref);\n\n return {\n vertical,\n ...state,\n };\n};\n"],"names":["useButtonBase_unstable","useToolbarButton_unstable","props","ref","appearance","baseProps","state","useToolbarButtonBase_unstable","size","shape","vertical","buttonProps"],"mappings":"AAAA;AAGA,SAASA,sBAAsB,QAAQ,yBAAyB;AAQhE;;;;;CAKC,GACD,OAAO,MAAMC,4BAA4B,CACvCC,OACAC;IAEA,MAAM,EAAEC,aAAa,QAAQ,EAAE,GAAGC,WAAW,GAAGH;IAChD,MAAMI,QAAQC,8BAA8BF,WAAWF;IAEvD,OAAO;QACLC;QACAI,MAAM;QACNC,OAAO;QACP,GAAGH,KAAK;IACV;AACF,EAAE;AAEF;;;;;;;CAOC,GACD,OAAO,MAAMC,gCAAgC,CAC3CL,OACAC;IAEA,MAAM,EAAEO,WAAW,KAAK,EAAE,GAAGC,aAAa,GAAGT;IAC7C,MAAMI,QAAQN,uBAAuBW,aAAaR;IAElD,OAAO;QACLO;QACA,GAAGJ,KAAK;IACV;AACF,EAAE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useButtonStyles_unstable } from "@fluentui/react-button";
|
|
4
|
+
import styles from "./ToolbarButton.module.css";
|
|
5
|
+
export const useToolbarButtonStyles_unstable = (state)=>{
|
|
6
|
+
useButtonStyles_unstable(state);
|
|
7
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
8
|
+
state.root.className = clsx(state.vertical && styles.vertical, state.root.className);
|
|
9
|
+
if (state.icon) {
|
|
10
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
11
|
+
state.icon.className = clsx(state.vertical && styles.verticalIcon, state.icon.className);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarButton/useToolbarButtonStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { useButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarButtonState } from './ToolbarButton.types';\nimport styles from './ToolbarButton.module.css';\n\nexport const useToolbarButtonStyles_unstable = (state: ToolbarButtonState): void => {\n useButtonStyles_unstable(state);\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(state.vertical && styles.vertical, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(state.vertical && styles.verticalIcon, state.icon.className);\n }\n};\n"],"names":["clsx","useButtonStyles_unstable","styles","useToolbarButtonStyles_unstable","state","root","className","vertical","icon","verticalIcon"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,wBAAwB,QAAQ,yBAAyB;AAElE,OAAOC,YAAY,6BAA6B;AAEhD,OAAO,MAAMC,kCAAkC,CAACC;IAC9CH,yBAAyBG;IAEzB,oDAAoD;IACpDA,MAAMC,IAAI,CAACC,SAAS,GAAGN,KAAKI,MAAMG,QAAQ,IAAIL,OAAOK,QAAQ,EAAEH,MAAMC,IAAI,CAACC,SAAS;IAEnF,IAAIF,MAAMI,IAAI,EAAE;QACd,oDAAoD;QACpDJ,MAAMI,IAAI,CAACF,SAAS,GAAGN,KAAKI,MAAMG,QAAQ,IAAIL,OAAOO,YAAY,EAAEL,MAAMI,IAAI,CAACF,SAAS;IACzF;AACF,EAAE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useButtonStyles_unstable } from "@fluentui/react-button";
|
|
4
|
+
import styles from "./ToolbarButton.module.css";
|
|
5
|
+
export const useToolbarButtonStyles_unstable = (state)=>{
|
|
6
|
+
useButtonStyles_unstable(state);
|
|
7
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
8
|
+
state.root.className = clsx(state.vertical && styles.vertical, state.root.className);
|
|
9
|
+
if (state.icon) {
|
|
10
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
11
|
+
state.icon.className = clsx(state.vertical && styles.verticalIcon, state.icon.className);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarButton/useToolbarButtonStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { useButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarButtonState } from './ToolbarButton.types';\nimport styles from './ToolbarButton.module.css';\n\nexport const useToolbarButtonStyles_unstable = (state: ToolbarButtonState): void => {\n useButtonStyles_unstable(state);\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(state.vertical && styles.vertical, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = clsx(state.vertical && styles.verticalIcon, state.icon.className);\n }\n};\n"],"names":["clsx","useButtonStyles_unstable","styles","useToolbarButtonStyles_unstable","state","root","className","vertical","icon","verticalIcon"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,wBAAwB,QAAQ,yBAAyB;AAElE,OAAOC,YAAY,6BAA6B;AAEhD,OAAO,MAAMC,kCAAkC,CAACC;IAC9CH,yBAAyBG;IAEzB,oDAAoD;IACpDA,MAAMC,IAAI,CAACC,SAAS,GAAGN,KAAKI,MAAMG,QAAQ,IAAIL,OAAOK,QAAQ,EAAEH,MAAMC,IAAI,CAACC,SAAS;IAEnF,IAAIF,MAAMI,IAAI,EAAE;QACd,oDAAoD;QACpDJ,MAAMI,IAAI,CAACF,SAAS,GAAGN,KAAKI,MAAMG,QAAQ,IAAIL,OAAOO,YAAY,EAAEL,MAAMI,IAAI,CAACF,SAAS;IACzF;AACF,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarButton/useToolbarButtonStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useButtonStyles_unstable } from '@fluentui/react-button';\nimport type { ToolbarButtonState } from './ToolbarButton.types';\n\nconst useBaseStyles = makeStyles({\n vertical: {\n flexDirection: 'column',\n },\n verticalIcon: {\n fontSize: '24px',\n margin: '0',\n },\n});\n\n/**\n * Apply styling to the ToolbarButton slots based on the state\n */\nexport const useToolbarButtonStyles_unstable = (state: ToolbarButtonState): void => {\n const buttonStyles = useBaseStyles();\n\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(state.vertical && buttonStyles.vertical, state.root.className);\n\n if (state.icon) {\n // eslint-disable-next-line react-hooks/immutability\n state.icon.className = mergeClasses(state.vertical && buttonStyles.verticalIcon, state.icon.className);\n }\n\n useButtonStyles_unstable(state);\n};\n"],"names":["makeStyles","mergeClasses","useButtonStyles_unstable","useBaseStyles","vertical","flexDirection","verticalIcon","fontSize","margin","useToolbarButtonStyles_unstable","state","buttonStyles","root","className","icon"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,wBAAwB,QAAQ,yBAAyB;AAGlE,MAAMC,gBAAgBH,WAAW;IAC/BI,UAAU;QACRC,eAAe;IACjB;IACAC,cAAc;QACZC,UAAU;QACVC,QAAQ;IACV;AACF;AAEA;;CAEC,GACD,OAAO,MAAMC,kCAAkC,CAACC;IAC9C,MAAMC,eAAeR;IAErB,oDAAoD;IACpDO,MAAME,IAAI,CAACC,SAAS,GAAGZ,aAAaS,MAAMN,QAAQ,IAAIO,aAAaP,QAAQ,EAAEM,MAAME,IAAI,CAACC,SAAS;IAEjG,IAAIH,MAAMI,IAAI,EAAE;QACd,oDAAoD;QACpDJ,MAAMI,IAAI,CAACD,SAAS,GAAGZ,aAAaS,MAAMN,QAAQ,IAAIO,aAAaL,YAAY,EAAEI,MAAMI,IAAI,CAACD,SAAS;IACvG;IAEAX,yBAAyBQ;AAC3B,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarDivider/ToolbarDivider.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { useToolbarDividerStyles_unstable } from './useToolbarDividerStyles.styles';\nimport type { ToolbarDividerProps } from './ToolbarDivider.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderDivider_unstable } from '@fluentui/react-divider';\nimport { useToolbarDivider_unstable } from './useToolbarDivider';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ToolbarDivider component\n */\nexport const ToolbarDivider: ForwardRefComponent<ToolbarDividerProps> = React.forwardRef((props, ref) => {\n const state = useToolbarDivider_unstable(props, ref);\n\n useToolbarDividerStyles_unstable(state);\n\n useCustomStyleHook_unstable('useToolbarDividerStyles_unstable')(state);\n\n return renderDivider_unstable(state);\n});\n\nToolbarDivider.displayName = 'ToolbarDivider';\n"],"names":["React","useToolbarDividerStyles_unstable","renderDivider_unstable","useToolbarDivider_unstable","useCustomStyleHook_unstable","ToolbarDivider","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,gCAAgC,QAAQ,sCAAmC;AAGpF,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,0BAA0B,QAAQ,yBAAsB;AACjE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;CAEC,GACD,OAAO,MAAMC,+BAA2DL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC/F,MAAMC,QAAQN,2BAA2BI,OAAOC;IAEhDP,iCAAiCQ;IAEjCL,4BAA4B,oCAAoCK;IAEhE,OAAOP,uBAAuBO;AAChC,GAAG;AAEHJ,eAAeK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarDivider/ToolbarDivider.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState } from '@fluentui/react-utilities';\nimport type { DividerSlots, DividerState, DividerBaseState } from '@fluentui/react-divider';\n\n/**\n * ToolbarDivider Props\n */\nexport type ToolbarDividerProps = ComponentProps<Partial<DividerSlots>> & {\n /**\n * A divider can be horizontal or vertical (default).\n *\n * @default true\n */\n vertical?: boolean;\n};\n\nexport type ToolbarDividerBaseProps = ToolbarDividerProps;\n\n/**\n * State used in rendering ToolbarDivider\n */\nexport type ToolbarDividerState = ComponentState<Partial<DividerSlots>> & DividerState;\n\nexport type ToolbarDividerBaseState = ComponentState<Partial<DividerSlots>> & DividerBaseState;\n"],"names":[],"mappings":"AAsBA,WAA+F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarDivider/index.ts"],"sourcesContent":["export { ToolbarDivider } from './ToolbarDivider';\nexport type {\n ToolbarDividerBaseProps,\n ToolbarDividerProps,\n ToolbarDividerBaseState,\n ToolbarDividerState,\n} from './ToolbarDivider.types';\nexport { useToolbarDividerStyles_unstable } from './useToolbarDividerStyles.styles';\nexport { useToolbarDivider_unstable, useToolbarDividerBase_unstable } from './useToolbarDivider';\n"],"names":["ToolbarDivider","useToolbarDividerStyles_unstable","useToolbarDivider_unstable","useToolbarDividerBase_unstable"],"mappings":"AAAA,SAASA,cAAc,QAAQ,sBAAmB;AAOlD,SAASC,gCAAgC,QAAQ,sCAAmC;AACpF,SAASC,0BAA0B,EAAEC,8BAA8B,QAAQ,yBAAsB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarDivider/useToolbarDivider.ts"],"sourcesContent":["'use client';\n\nimport type * as React from 'react';\nimport type {\n ToolbarDividerBaseProps,\n ToolbarDividerBaseState,\n ToolbarDividerProps,\n ToolbarDividerState,\n} from './ToolbarDivider.types';\nimport { useDividerBase_unstable } from '@fluentui/react-divider';\nimport { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';\n\n/**\n * Create the state required to render ToolbarDivider.\n *\n * The returned state can be modified with hooks such as useToolbarDividerStyles_unstable,\n * before being passed to renderToolbar_unstable.\n *\n * @param props - props from this instance of ToolbarDivider\n * @param ref - reference to root HTMLElement of ToolbarDivider\n */\nexport const useToolbarDivider_unstable = (\n props: ToolbarDividerProps,\n ref: React.Ref<HTMLElement>,\n): ToolbarDividerState => {\n const state = useToolbarDividerBase_unstable(props, ref);\n return {\n alignContent: 'center',\n appearance: 'default',\n inset: false,\n ...state,\n };\n};\n\n/**\n * Base hook that builds ToolbarDivider state for behavior and structure only.\n * It does not provide any design-related defaults.\n *\n * @internal\n * @param props - props from this instance of ToolbarDivider\n * @param ref - reference to root HTMLElement of ToolbarDivider\n */\nexport const useToolbarDividerBase_unstable = (\n props: ToolbarDividerBaseProps,\n ref: React.Ref<HTMLElement>,\n): ToolbarDividerBaseState => {\n const vertical = useToolbarContext_unstable(ctx => ctx.vertical);\n return useDividerBase_unstable({ vertical: !vertical, ...props }, ref);\n};\n"],"names":["useDividerBase_unstable","useToolbarContext_unstable","useToolbarDivider_unstable","props","ref","state","useToolbarDividerBase_unstable","alignContent","appearance","inset","vertical","ctx"],"mappings":"AAAA;AASA,SAASA,uBAAuB,QAAQ,0BAA0B;AAClE,SAASC,0BAA0B,QAAQ,+BAA4B;AAEvE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,QAAQC,+BAA+BH,OAAOC;IACpD,OAAO;QACLG,cAAc;QACdC,YAAY;QACZC,OAAO;QACP,GAAGJ,KAAK;IACV;AACF,EAAE;AAEF;;;;;;;CAOC,GACD,OAAO,MAAMC,iCAAiC,CAC5CH,OACAC;IAEA,MAAMM,WAAWT,2BAA2BU,CAAAA,MAAOA,IAAID,QAAQ;IAC/D,OAAOV,wBAAwB;QAAEU,UAAU,CAACA;QAAU,GAAGP,KAAK;IAAC,GAAGC;AACpE,EAAE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useDividerStyles_unstable } from "@fluentui/react-divider";
|
|
4
|
+
import styles from "./ToolbarDivider.module.css";
|
|
5
|
+
export const useToolbarDividerStyles_unstable = (state)=>{
|
|
6
|
+
useDividerStyles_unstable(state);
|
|
7
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
8
|
+
state.root.className = clsx(styles.root, !state.vertical && styles.horizontal, state.root.className);
|
|
9
|
+
return state;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarDivider/useToolbarDividerStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { useDividerStyles_unstable } from '@fluentui/react-divider';\nimport type { ToolbarDividerState } from './ToolbarDivider.types';\nimport styles from './ToolbarDivider.module.css';\n\nexport const useToolbarDividerStyles_unstable = (state: ToolbarDividerState): ToolbarDividerState => {\n useDividerStyles_unstable(state);\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(styles.root, !state.vertical && styles.horizontal, state.root.className);\n return state;\n};\n"],"names":["clsx","useDividerStyles_unstable","styles","useToolbarDividerStyles_unstable","state","root","className","vertical","horizontal"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,yBAAyB,QAAQ,0BAA0B;AAEpE,OAAOC,YAAY,8BAA8B;AAEjD,OAAO,MAAMC,mCAAmC,CAACC;IAC/CH,0BAA0BG;IAC1B,oDAAoD;IACpDA,MAAMC,IAAI,CAACC,SAAS,GAAGN,KAAKE,OAAOG,IAAI,EAAE,CAACD,MAAMG,QAAQ,IAAIL,OAAOM,UAAU,EAAEJ,MAAMC,IAAI,CAACC,SAAS;IACnG,OAAOF;AACT,EAAE"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from "clsx";
|
|
3
|
+
import { useDividerStyles_unstable } from "@fluentui/react-divider";
|
|
4
|
+
import styles from "./ToolbarDivider.module.css";
|
|
5
|
+
export const useToolbarDividerStyles_unstable = (state)=>{
|
|
6
|
+
useDividerStyles_unstable(state);
|
|
7
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
8
|
+
state.root.className = clsx(styles.root, !state.vertical && styles.horizontal, state.root.className);
|
|
9
|
+
return state;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarDivider/useToolbarDividerStyles.styles.css.ts"],"sourcesContent":["'use client';\n\nimport { clsx } from 'clsx';\nimport { useDividerStyles_unstable } from '@fluentui/react-divider';\nimport type { ToolbarDividerState } from './ToolbarDivider.types';\nimport styles from './ToolbarDivider.module.css';\n\nexport const useToolbarDividerStyles_unstable = (state: ToolbarDividerState): ToolbarDividerState => {\n useDividerStyles_unstable(state);\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = clsx(styles.root, !state.vertical && styles.horizontal, state.root.className);\n return state;\n};\n"],"names":["clsx","useDividerStyles_unstable","styles","useToolbarDividerStyles_unstable","state","root","className","vertical","horizontal"],"mappings":"AAAA;AAEA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,yBAAyB,QAAQ,0BAA0B;AAEpE,OAAOC,YAAY,8BAA8B;AAEjD,OAAO,MAAMC,mCAAmC,CAACC;IAC/CH,0BAA0BG;IAC1B,oDAAoD;IACpDA,MAAMC,IAAI,CAACC,SAAS,GAAGN,KAAKE,OAAOG,IAAI,EAAE,CAACD,MAAMG,QAAQ,IAAIL,OAAOM,UAAU,EAAEJ,MAAMC,IAAI,CAACC,SAAS;IACnG,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarDivider/useToolbarDividerStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport { useDividerStyles_unstable } from '@fluentui/react-divider';\nimport type { ToolbarDividerState } from './ToolbarDivider.types';\n\nconst useBaseStyles = makeStyles({\n // Base styles\n root: {\n display: 'inline-flex',\n maxWidth: '1px',\n padding: '0 12px',\n },\n vertical: {\n maxWidth: 'initial',\n },\n});\n\n/**\n * Apply styling to the ToolbarDivider slots based on the state\n */\nexport const useToolbarDividerStyles_unstable = (state: ToolbarDividerState): ToolbarDividerState => {\n useDividerStyles_unstable(state);\n const { vertical } = state;\n const toolbarDividerStyles = useBaseStyles();\n // eslint-disable-next-line react-hooks/immutability\n state.root.className = mergeClasses(\n toolbarDividerStyles.root,\n !vertical && toolbarDividerStyles.vertical,\n state.root.className,\n );\n return state;\n};\n"],"names":["makeStyles","mergeClasses","useDividerStyles_unstable","useBaseStyles","root","display","maxWidth","padding","vertical","useToolbarDividerStyles_unstable","state","toolbarDividerStyles","className"],"mappings":"AAAA;AAEA,SAASA,UAAU,EAAEC,YAAY,QAAQ,iBAAiB;AAC1D,SAASC,yBAAyB,QAAQ,0BAA0B;AAGpE,MAAMC,gBAAgBH,WAAW;IAC/B,cAAc;IACdI,MAAM;QACJC,SAAS;QACTC,UAAU;QACVC,SAAS;IACX;IACAC,UAAU;QACRF,UAAU;IACZ;AACF;AAEA;;CAEC,GACD,OAAO,MAAMG,mCAAmC,CAACC;IAC/CR,0BAA0BQ;IAC1B,MAAM,EAAEF,QAAQ,EAAE,GAAGE;IACrB,MAAMC,uBAAuBR;IAC7B,oDAAoD;IACpDO,MAAMN,IAAI,CAACQ,SAAS,GAAGX,aACrBU,qBAAqBP,IAAI,EACzB,CAACI,YAAYG,qBAAqBH,QAAQ,EAC1CE,MAAMN,IAAI,CAACQ,SAAS;IAEtB,OAAOF;AACT,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarGroup/ToolbarGroup.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { ToolbarGroupProps } from './ToolbarGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useToolbarGroup_unstable } from './useToolbarGroup';\nimport { useToolbarGroupStyles_unstable } from './useToolbarGroupStyles.styles';\nimport { renderToolbarGroup_unstable } from './renderToolbarGroup';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * ToolbarGroup component is a Button to be used inside Toolbar\n * which will respect toolbar props such as `size`\n */\nexport const ToolbarGroup: ForwardRefComponent<ToolbarGroupProps> = React.forwardRef((props, ref) => {\n const state = useToolbarGroup_unstable(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<ToolbarGroupProps>;\n\nToolbarGroup.displayName = 'ToolbarGroup';\n"],"names":["React","useToolbarGroup_unstable","useToolbarGroupStyles_unstable","renderToolbarGroup_unstable","useCustomStyleHook_unstable","ToolbarGroup","forwardRef","props","ref","state","displayName"],"mappings":"AAAA;AAEA,YAAYA,WAAW,QAAQ;AAG/B,SAASC,wBAAwB,QAAQ,uBAAoB;AAC7D,SAASC,8BAA8B,QAAQ,oCAAiC;AAChF,SAASC,2BAA2B,QAAQ,0BAAuB;AACnE,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E;;;CAGC,GACD,OAAO,MAAMC,6BAAuDL,MAAMM,UAAU,CAAC,CAACC,OAAOC;IAC3F,MAAMC,QAAQR,yBAAyBM,OAAOC;IAE9CN,+BAA+BO;IAE/BL,4BAA4B,kCAAkCK;IAE9D,OAAON,4BAA4BM;AACnC,0FAA0F;AAC5F,GAA6C;AAE7CJ,aAAaK,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarGroup/ToolbarGroup.types.ts"],"sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type ToolbarGroupSlots = {\n root: Slot<'div'>;\n};\n\n/**\n * ToolbarButton Props\n */\nexport type ToolbarGroupProps = ComponentProps<ToolbarGroupSlots>;\n\n/**\n * State used in rendering ToolbarButton\n */\nexport type ToolbarGroupState = ComponentState<ToolbarGroupSlots> & {\n vertical?: boolean;\n};\n"],"names":[],"mappings":"AAWA;;CAEC,GACD,WAEE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarGroup/index.ts"],"sourcesContent":["export { ToolbarGroup } from './ToolbarGroup';\nexport type { ToolbarGroupProps, ToolbarGroupSlots, ToolbarGroupState } from './ToolbarGroup.types';\nexport { useToolbarGroup_unstable, useToolbarGroupBase_unstable } from './useToolbarGroup';\nexport { toolbarGroupClassNames, useToolbarGroupStyles_unstable } from './useToolbarGroupStyles.styles';\nexport { renderToolbarGroup_unstable } from './renderToolbarGroup';\n"],"names":["ToolbarGroup","useToolbarGroup_unstable","useToolbarGroupBase_unstable","toolbarGroupClassNames","useToolbarGroupStyles_unstable","renderToolbarGroup_unstable"],"mappings":"AAAA,SAASA,YAAY,QAAQ,oBAAiB;AAE9C,SAASC,wBAAwB,EAAEC,4BAA4B,QAAQ,uBAAoB;AAC3F,SAASC,sBAAsB,EAAEC,8BAA8B,QAAQ,oCAAiC;AACxG,SAASC,2BAA2B,QAAQ,0BAAuB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { assertSlots } from "@fluentui/react-utilities";
|
|
1
|
+
import { jsx as _jsx } from "@fluentui/react-jsx-runtime/jsx-runtime";
|
|
2
|
+
import { assertSlots } from "@fluentui/react-utilities";
|
|
3
3
|
/**
|
|
4
4
|
* Render the final JSX of ToolbarGroup
|
|
5
5
|
*/ export const renderToolbarGroup_unstable = (state)=>{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/ToolbarGroup/renderToolbarGroup.tsx"],"sourcesContent":["/** @jsxRuntime automatic */\n/** @jsxImportSource @fluentui/react-jsx-runtime */\nimport { assertSlots } from '@fluentui/react-utilities';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport type { ToolbarGroupState, ToolbarGroupSlots } from './ToolbarGroup.types';\n\n/**\n * Render the final JSX of ToolbarGroup\n */\nexport const renderToolbarGroup_unstable = (state: ToolbarGroupState): JSXElement => {\n assertSlots<ToolbarGroupSlots>(state);\n\n return <state.root>{state.root.children}</state.root>;\n};\n"],"names":["assertSlots","renderToolbarGroup_unstable","state","root","children"],"mappings":";AAAA,0BAA0B,GAC1B,iDAAiD,GACjD,SAASA,WAAW,QAAQ,4BAA4B;AAIxD;;CAEC,GACD,OAAO,MAAMC,8BAA8B,CAACC;IAC1CF,YAA+BE;IAE/B,qBAAO,KAACA,MAAMC,IAAI;kBAAED,MAAMC,IAAI,CAACC,QAAQ;;AACzC,EAAE"}
|
|
@@ -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"}
|