@fluentui/react-toolbar 9.0.0-beta.14 → 9.0.0-beta.15

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 CHANGED
@@ -2,7 +2,60 @@
2
2
  "name": "@fluentui/react-toolbar",
3
3
  "entries": [
4
4
  {
5
- "date": "Thu, 17 Nov 2022 23:02:27 GMT",
5
+ "date": "Mon, 05 Dec 2022 18:25:36 GMT",
6
+ "tag": "@fluentui/react-toolbar_v9.0.0-beta.15",
7
+ "version": "9.0.0-beta.15",
8
+ "comments": {
9
+ "none": [
10
+ {
11
+ "author": "chassunc@microsoft.com",
12
+ "package": "@fluentui/react-toolbar",
13
+ "commit": "803091ab911f810964555cedb64f7355df2d4554",
14
+ "comment": "chore: update default button appearance for toolbar"
15
+ },
16
+ {
17
+ "author": "chassunc@microsoft.com",
18
+ "package": "@fluentui/react-toolbar",
19
+ "commit": "1bff9a3148961667fe516b46fead5798db794ae6",
20
+ "comment": "feat: add large size for toolbar"
21
+ }
22
+ ],
23
+ "prerelease": [
24
+ {
25
+ "author": "beachball",
26
+ "package": "@fluentui/react-toolbar",
27
+ "comment": "Bump @fluentui/react-button to v9.1.10",
28
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
29
+ },
30
+ {
31
+ "author": "beachball",
32
+ "package": "@fluentui/react-toolbar",
33
+ "comment": "Bump @fluentui/react-divider to v9.1.6",
34
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
35
+ },
36
+ {
37
+ "author": "beachball",
38
+ "package": "@fluentui/react-toolbar",
39
+ "comment": "Bump @fluentui/react-theme to v9.1.3",
40
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
41
+ },
42
+ {
43
+ "author": "beachball",
44
+ "package": "@fluentui/react-toolbar",
45
+ "comment": "Bump @fluentui/react-radio to v9.0.13",
46
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
47
+ },
48
+ {
49
+ "author": "beachball",
50
+ "package": "@fluentui/react-toolbar",
51
+ "comment": "Bump @fluentui/react-tabster to v9.3.2",
52
+ "commit": "4c29542a51bf068e171690cc8e59c14489883912"
53
+ }
54
+ ]
55
+ }
56
+ },
57
+ {
58
+ "date": "Thu, 17 Nov 2022 23:05:30 GMT",
6
59
  "tag": "@fluentui/react-toolbar_v9.0.0-beta.14",
7
60
  "version": "9.0.0-beta.14",
8
61
  "comments": {
package/CHANGELOG.md CHANGED
@@ -1,12 +1,25 @@
1
1
  # Change Log - @fluentui/react-toolbar
2
2
 
3
- This log was last generated on Thu, 17 Nov 2022 23:02:27 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 05 Dec 2022 18:25:36 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
+ ## [9.0.0-beta.15](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.15)
8
+
9
+ Mon, 05 Dec 2022 18:25:36 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.14..@fluentui/react-toolbar_v9.0.0-beta.15)
11
+
12
+ ### Changes
13
+
14
+ - Bump @fluentui/react-button to v9.1.10 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
15
+ - Bump @fluentui/react-divider to v9.1.6 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
16
+ - Bump @fluentui/react-theme to v9.1.3 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
17
+ - Bump @fluentui/react-radio to v9.0.13 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
18
+ - Bump @fluentui/react-tabster to v9.3.2 ([PR #25798](https://github.com/microsoft/fluentui/pull/25798) by beachball)
19
+
7
20
  ## [9.0.0-beta.14](https://github.com/microsoft/fluentui/tree/@fluentui/react-toolbar_v9.0.0-beta.14)
8
21
 
9
- Thu, 17 Nov 2022 23:02:27 GMT
22
+ Thu, 17 Nov 2022 23:05:30 GMT
10
23
  [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-toolbar_v9.0.0-beta.13..@fluentui/react-toolbar_v9.0.0-beta.14)
11
24
 
12
25
  ### Changes
package/dist/index.d.ts CHANGED
@@ -95,7 +95,7 @@ export declare type ToolbarProps = ComponentProps<ToolbarSlots> & {
95
95
  *
96
96
  * @default medium
97
97
  */
98
- size?: 'small' | 'medium';
98
+ size?: 'small' | 'medium' | 'large';
99
99
  /**
100
100
  * Toolbar can be vertical styled
101
101
  * @default false
@@ -1 +1 @@
1
- {"version":3,"file":"Toolbar.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/Toolbar.types.ts"],"names":[],"mappings":"","sourcesContent":["import * 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';\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 onCheckedValueChange?: (e: ToolbarCheckedValueChangeEvent, data: ToolbarCheckedValueChangeData) => void;\n};\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 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<ToolbarState, '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"]}
1
+ {"version":3,"file":"Toolbar.types.js","sourceRoot":"../src/","sources":["packages/react-components/react-toolbar/src/components/Toolbar/Toolbar.types.ts"],"names":[],"mappings":"","sourcesContent":["import * 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 onCheckedValueChange?: (e: ToolbarCheckedValueChangeEvent, data: ToolbarCheckedValueChangeData) => void;\n};\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 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<ToolbarState, '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"]}
@@ -9,6 +9,7 @@ export const toolbarClassNames = {
9
9
  const useStyles = /*#__PURE__*/__styles({
10
10
  "root": {
11
11
  "mc9l5x": "f22iagw",
12
+ "Bt984gj": "f122n59",
12
13
  "z8tnut": "f10ra9hq",
13
14
  "z189sj": ["f19lj068", "f177v4lu"],
14
15
  "Byoj8tv": "f1y2xyjm",
@@ -19,9 +20,18 @@ const useStyles = /*#__PURE__*/__styles({
19
20
  "vertical": {
20
21
  "Beiy3e4": "f1vx9l62",
21
22
  "a9b677": "f1acs6jw"
23
+ },
24
+ "small": {
25
+ "Bqenvij": "f1d2rq10"
26
+ },
27
+ "medium": {
28
+ "Bqenvij": "fbhnoac"
29
+ },
30
+ "large": {
31
+ "Bqenvij": "ff2sm71"
22
32
  }
23
33
  }, {
24
- "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f10ra9hq{padding-top:4px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1y2xyjm{padding-bottom:4px;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}"]
34
+ "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;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}", ".f1d2rq10{height:32px;}", ".fbhnoac{height:40px;}", ".ff2sm71{height:48px;}"]
25
35
  });
26
36
  /**
27
37
  * Apply styling to the Toolbar slots based on the state
@@ -31,9 +41,10 @@ const useStyles = /*#__PURE__*/__styles({
31
41
  export const useToolbarStyles_unstable = state => {
32
42
  const styles = useStyles();
33
43
  const {
34
- vertical
44
+ vertical,
45
+ size
35
46
  } = state;
36
- state.root.className = mergeClasses(toolbarClassNames.root, styles.root, vertical && styles.vertical, state.root.className);
47
+ 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);
37
48
  return state;
38
49
  };
39
50
  //# sourceMappingURL=useToolbarStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbarStyles.ts"],"names":[],"mappings":"AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,OAAO,MAAM,iBAAiB,GAAiC;EAC7D,IAAI,EAAE;AADuD,CAAxD;AAIP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAAsC;EAC7E,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE;EAAF,IAAe,KAArB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,iBAAiB,CAAC,IADe,EAEjC,MAAM,CAAC,IAF0B,EAGjC,QAAQ,IAAI,MAAM,CAAC,QAHc,EAIjC,KAAK,CAAC,IAAN,CAAW,SAJsB,CAAnC;EAOA,OAAO,KAAP;AACD,CAXM","sourcesContent":["import { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } 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 ...shorthands.padding('4px', '8px', '4px', '8px'),\n ...shorthands.gap('8px'),\n },\n vertical: {\n flexDirection: 'column',\n width: 'fit-content',\n },\n});\n\n/**\n * Apply styling to the Toolbar slots based on the state\n */\nexport const useToolbarStyles_unstable = (state: ToolbarState): ToolbarState => {\n const styles = useStyles();\n const { vertical } = state;\n state.root.className = mergeClasses(\n toolbarClassNames.root,\n styles.root,\n vertical && styles.vertical,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbarStyles.ts"],"names":[],"mappings":"AACA,mBAAqB,YAArB,EAAmC,UAAnC,QAAqD,gBAArD;AAGA,OAAO,MAAM,iBAAiB,GAAiC;EAC7D,IAAI,EAAE;AADuD,CAAxD;AAIP;;AAEG;;AACH,MAAM,SAAS,gBAAG;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAsBA;;AAEG;;;AACH,OAAO,MAAM,yBAAyB,GAAI,KAAD,IAAsC;EAC7E,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAqB,KAA3B;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,YAAY,CACjC,iBAAiB,CAAC,IADe,EAEjC,MAAM,CAAC,IAF0B,EAGjC,QAAQ,IAAI,MAAM,CAAC,QAHc,EAIjC,IAAI,KAAK,OAAT,IAAoB,CAAC,QAArB,IAAiC,MAAM,CAAC,KAJP,EAKjC,IAAI,KAAK,QAAT,IAAqB,CAAC,QAAtB,IAAkC,MAAM,CAAC,MALR,EAMjC,IAAI,KAAK,OAAT,IAAoB,CAAC,QAArB,IAAiC,MAAM,CAAC,KANP,EAOjC,KAAK,CAAC,IAAN,CAAW,SAPsB,CAAnC;EAUA,OAAO,KAAP;AACD,CAdM","sourcesContent":["import { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } 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 ...shorthands.padding('4px', '8px', '4px', '8px'),\n ...shorthands.gap('8px'),\n },\n vertical: {\n flexDirection: 'column',\n width: 'fit-content',\n },\n small: {\n height: '32px',\n },\n medium: {\n height: '40px',\n },\n large: {\n height: '48px',\n },\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 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"],"sourceRoot":"../src/"}
@@ -1,16 +1,13 @@
1
1
  import * as React from 'react';
2
2
  import { renderButton_unstable, useButtonStyles_unstable, useButton_unstable } from '@fluentui/react-button';
3
- import { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';
4
3
  /**
5
4
  * ToolbarButton component is a Button to be used inside Toolbar
6
5
  * which will respect toolbar props such as `size`
7
6
  */
8
7
 
9
8
  export const ToolbarButton = /*#__PURE__*/React.forwardRef((props, ref) => {
10
- const size = useToolbarContext_unstable(ctx => ctx.size);
11
9
  const state = useButton_unstable({
12
- size,
13
- appearance: 'transparent',
10
+ appearance: 'subtle',
14
11
  ...props
15
12
  }, ref);
16
13
  useButtonStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,SAAS,qBAAT,EAAgC,wBAAhC,EAA0D,kBAA1D,QAAoF,wBAApF;AACA,SAAS,0BAAT,QAA2C,2BAA3C;AAEA;;;AAGG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,IAAI,GAAG,0BAA0B,CAAC,GAAG,IAAI,GAAG,CAAC,IAAZ,CAAvC;EACA,MAAM,KAAK,GAAG,kBAAkB,CAAC;IAAE,IAAF;IAAQ,UAAU,EAAE,aAApB;IAAmC,GAAG;EAAtC,CAAD,EAAgD,GAAhD,CAAhC;EACA,wBAAwB,CAAC,KAAD,CAAxB;EACA,OAAO,qBAAqB,CAAC,KAAD,CAA5B,CAJoG,CAKpG;AACD,CANqE,CAA/D;AAQP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport type { ToolbarButtonProps } from './ToolbarButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderButton_unstable, useButtonStyles_unstable, useButton_unstable } from '@fluentui/react-button';\nimport { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';\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 size = useToolbarContext_unstable(ctx => ctx.size);\n const state = useButton_unstable({ size, appearance: 'transparent', ...props }, ref);\n useButtonStyles_unstable(state);\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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAGA,SAAS,qBAAT,EAAgC,wBAAhC,EAA0D,kBAA1D,QAAoF,wBAApF;AAEA;;;AAGG;;AACH,OAAO,MAAM,aAAa,gBAA4C,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,kBAAkB,CAAC;IAAE,UAAU,EAAE,QAAd;IAAwB,GAAG;EAA3B,CAAD,EAAqC,GAArC,CAAhC;EACA,wBAAwB,CAAC,KAAD,CAAxB;EACA,OAAO,qBAAqB,CAAC,KAAD,CAA5B,CAHoG,CAIpG;AACD,CALqE,CAA/D;AAOP,aAAa,CAAC,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport type { ToolbarButtonProps } from './ToolbarButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderButton_unstable, useButtonStyles_unstable, useButton_unstable } from '@fluentui/react-button';\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 = useButton_unstable({ appearance: 'subtle', ...props }, ref);\n useButtonStyles_unstable(state);\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"],"sourceRoot":"../src/"}
@@ -17,6 +17,7 @@ exports.toolbarClassNames = {
17
17
  const useStyles = /*#__PURE__*/react_1.__styles({
18
18
  "root": {
19
19
  "mc9l5x": "f22iagw",
20
+ "Bt984gj": "f122n59",
20
21
  "z8tnut": "f10ra9hq",
21
22
  "z189sj": ["f19lj068", "f177v4lu"],
22
23
  "Byoj8tv": "f1y2xyjm",
@@ -27,9 +28,18 @@ const useStyles = /*#__PURE__*/react_1.__styles({
27
28
  "vertical": {
28
29
  "Beiy3e4": "f1vx9l62",
29
30
  "a9b677": "f1acs6jw"
31
+ },
32
+ "small": {
33
+ "Bqenvij": "f1d2rq10"
34
+ },
35
+ "medium": {
36
+ "Bqenvij": "fbhnoac"
37
+ },
38
+ "large": {
39
+ "Bqenvij": "ff2sm71"
30
40
  }
31
41
  }, {
32
- "d": [".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f10ra9hq{padding-top:4px;}", ".f19lj068{padding-right:8px;}", ".f177v4lu{padding-left:8px;}", ".f1y2xyjm{padding-bottom:4px;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}"]
42
+ "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;}", ".f4px1ci{-webkit-column-gap:8px;column-gap:8px;}", ".fn67r4l{row-gap:8px;}", ".f1vx9l62{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}", ".f1acs6jw{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;}", ".f1d2rq10{height:32px;}", ".fbhnoac{height:40px;}", ".ff2sm71{height:48px;}"]
33
43
  });
34
44
  /**
35
45
  * Apply styling to the Toolbar slots based on the state
@@ -39,9 +49,10 @@ const useStyles = /*#__PURE__*/react_1.__styles({
39
49
  const useToolbarStyles_unstable = state => {
40
50
  const styles = useStyles();
41
51
  const {
42
- vertical
52
+ vertical,
53
+ size
43
54
  } = state;
44
- state.root.className = react_1.mergeClasses(exports.toolbarClassNames.root, styles.root, vertical && styles.vertical, state.root.className);
55
+ state.root.className = react_1.mergeClasses(exports.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);
45
56
  return state;
46
57
  };
47
58
 
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbarStyles.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGa,OAAA,CAAA,iBAAA,GAAkD;EAC7D,IAAI,EAAE;AADuD,CAAlD;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAYA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAAsC;EAC7E,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE;EAAF,IAAe,KAArB;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,iBAAA,CAAkB,IADG,EAErB,MAAM,CAAC,IAFc,EAGrB,QAAQ,IAAI,MAAM,CAAC,QAHE,EAIrB,KAAK,CAAC,IAAN,CAAW,SAJU,CAAvB;EAOA,OAAO,KAAP;AACD,CAXM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } 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 ...shorthands.padding('4px', '8px', '4px', '8px'),\n ...shorthands.gap('8px'),\n },\n vertical: {\n flexDirection: 'column',\n width: 'fit-content',\n },\n});\n\n/**\n * Apply styling to the Toolbar slots based on the state\n */\nexport const useToolbarStyles_unstable = (state: ToolbarState): ToolbarState => {\n const styles = useStyles();\n const { vertical } = state;\n state.root.className = mergeClasses(\n toolbarClassNames.root,\n styles.root,\n vertical && styles.vertical,\n state.root.className,\n );\n\n return state;\n};\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-toolbar/src/components/Toolbar/useToolbarStyles.ts"],"names":[],"mappings":";;;;;;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,gBAAA,CAAA;;AAGa,OAAA,CAAA,iBAAA,GAAkD;EAC7D,IAAI,EAAE;AADuD,CAAlD;AAIb;;AAEG;;AACH,MAAM,SAAS,gBAAG,OAAA,SAAA;EAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;IAAA;EAAA;EAAA;IAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;EAAA;IAAA;EAAA;AAAA;EAAA;AAAA,EAAlB;AAsBA;;AAEG;;;AACI,MAAM,yBAAyB,GAAI,KAAD,IAAsC;EAC7E,MAAM,MAAM,GAAG,SAAS,EAAxB;EACA,MAAM;IAAE,QAAF;IAAY;EAAZ,IAAqB,KAA3B;EACA,KAAK,CAAC,IAAN,CAAW,SAAX,GAAuB,OAAA,CAAA,YAAA,CACrB,OAAA,CAAA,iBAAA,CAAkB,IADG,EAErB,MAAM,CAAC,IAFc,EAGrB,QAAQ,IAAI,MAAM,CAAC,QAHE,EAIrB,IAAI,KAAK,OAAT,IAAoB,CAAC,QAArB,IAAiC,MAAM,CAAC,KAJnB,EAKrB,IAAI,KAAK,QAAT,IAAqB,CAAC,QAAtB,IAAkC,MAAM,CAAC,MALpB,EAMrB,IAAI,KAAK,OAAT,IAAoB,CAAC,QAArB,IAAiC,MAAM,CAAC,KANnB,EAOrB,KAAK,CAAC,IAAN,CAAW,SAPU,CAAvB;EAUA,OAAO,KAAP;AACD,CAdM;;AAAM,OAAA,CAAA,yBAAA,GAAyB,yBAAzB","sourcesContent":["import { SlotClassNames } from '@fluentui/react-utilities';\nimport { makeStyles, mergeClasses, shorthands } 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 ...shorthands.padding('4px', '8px', '4px', '8px'),\n ...shorthands.gap('8px'),\n },\n vertical: {\n flexDirection: 'column',\n width: 'fit-content',\n },\n small: {\n height: '32px',\n },\n medium: {\n height: '40px',\n },\n large: {\n height: '48px',\n },\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 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"],"sourceRoot":"../src/"}
@@ -8,8 +8,6 @@ exports.ToolbarButton = void 0;
8
8
  const React = /*#__PURE__*/require("react");
9
9
 
10
10
  const react_button_1 = /*#__PURE__*/require("@fluentui/react-button");
11
-
12
- const ToolbarContext_1 = /*#__PURE__*/require("../Toolbar/ToolbarContext");
13
11
  /**
14
12
  * ToolbarButton component is a Button to be used inside Toolbar
15
13
  * which will respect toolbar props such as `size`
@@ -17,10 +15,8 @@ const ToolbarContext_1 = /*#__PURE__*/require("../Toolbar/ToolbarContext");
17
15
 
18
16
 
19
17
  exports.ToolbarButton = /*#__PURE__*/React.forwardRef((props, ref) => {
20
- const size = ToolbarContext_1.useToolbarContext_unstable(ctx => ctx.size);
21
18
  const state = react_button_1.useButton_unstable({
22
- size,
23
- appearance: 'transparent',
19
+ appearance: 'subtle',
24
20
  ...props
25
21
  }, ref);
26
22
  react_button_1.useButtonStyles_unstable(state);
@@ -1 +1 @@
1
- {"version":3,"sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAGA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAEA;;;AAGG;;;AACU,OAAA,CAAA,aAAA,gBAAyD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,IAAI,GAAG,gBAAA,CAAA,0BAAA,CAA2B,GAAG,IAAI,GAAG,CAAC,IAAtC,CAAb;EACA,MAAM,KAAK,GAAG,cAAA,CAAA,kBAAA,CAAmB;IAAE,IAAF;IAAQ,UAAU,EAAE,aAApB;IAAmC,GAAG;EAAtC,CAAnB,EAAkE,GAAlE,CAAd;EACA,cAAA,CAAA,wBAAA,CAAyB,KAAzB;EACA,OAAO,cAAA,CAAA,qBAAA,CAAsB,KAAtB,CAAP,CAJoG,CAKpG;AACD,CANqE,CAAzD;AAQb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport type { ToolbarButtonProps } from './ToolbarButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderButton_unstable, useButtonStyles_unstable, useButton_unstable } from '@fluentui/react-button';\nimport { useToolbarContext_unstable } from '../Toolbar/ToolbarContext';\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 size = useToolbarContext_unstable(ctx => ctx.size);\n const state = useButton_unstable({ size, appearance: 'transparent', ...props }, ref);\n useButtonStyles_unstable(state);\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"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["packages/react-components/react-toolbar/src/components/ToolbarButton/ToolbarButton.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AAGA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;AAEA;;;AAGG;;;AACU,OAAA,CAAA,aAAA,gBAAyD,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;EACpG,MAAM,KAAK,GAAG,cAAA,CAAA,kBAAA,CAAmB;IAAE,UAAU,EAAE,QAAd;IAAwB,GAAG;EAA3B,CAAnB,EAAuD,GAAvD,CAAd;EACA,cAAA,CAAA,wBAAA,CAAyB,KAAzB;EACA,OAAO,cAAA,CAAA,qBAAA,CAAsB,KAAtB,CAAP,CAHoG,CAIpG;AACD,CALqE,CAAzD;AAOb,OAAA,CAAA,aAAA,CAAc,WAAd,GAA4B,eAA5B","sourcesContent":["import * as React from 'react';\nimport type { ToolbarButtonProps } from './ToolbarButton.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { renderButton_unstable, useButtonStyles_unstable, useButton_unstable } from '@fluentui/react-button';\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 = useButton_unstable({ appearance: 'subtle', ...props }, ref);\n useButtonStyles_unstable(state);\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"],"sourceRoot":"../src/"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluentui/react-toolbar",
3
- "version": "9.0.0-beta.14",
3
+ "version": "9.0.0-beta.15",
4
4
  "description": "React components for building web experiences",
5
5
  "main": "lib-commonjs/index.js",
6
6
  "module": "lib/index.js",
@@ -32,13 +32,13 @@
32
32
  "@fluentui/scripts": "^1.0.0"
33
33
  },
34
34
  "dependencies": {
35
- "@fluentui/react-button": "^9.1.9",
36
- "@fluentui/react-divider": "^9.1.5",
37
- "@fluentui/react-theme": "^9.1.2",
35
+ "@fluentui/react-button": "^9.1.10",
36
+ "@fluentui/react-divider": "^9.1.6",
37
+ "@fluentui/react-theme": "^9.1.3",
38
38
  "@fluentui/react-utilities": "^9.2.2",
39
39
  "@fluentui/react-context-selector": "^9.1.2",
40
- "@fluentui/react-radio": "^9.0.12",
41
- "@fluentui/react-tabster": "^9.3.1",
40
+ "@fluentui/react-radio": "^9.0.13",
41
+ "@fluentui/react-tabster": "^9.3.2",
42
42
  "@griffel/react": "^1.4.2",
43
43
  "tslib": "^2.1.0"
44
44
  },