@appquality/unguess-design-system 3.1.52 → 3.1.54

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.
@@ -34,7 +34,7 @@ jobs:
34
34
  yarn-deps-${{ hashFiles('yarn.lock') }}
35
35
  - name: Create Release
36
36
  env:
37
- GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
37
+ GITHUB_TOKEN: ${{ secrets.REPO_PAT }}
38
38
  #👇 npm token, see https://storybook.js.org/tutorials/design-systems-for-developers/react/en/distribute/ to obtain it
39
39
  NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
40
40
  run: |
package/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ # v3.1.54 (Tue Nov 14 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - chore(styled-components): update to 6.1.1 [#278](https://github.com/AppQuality/unguess-design-system/pull/278) ([@cannarocks](https://github.com/cannarocks))
6
+
7
+ #### Authors: 1
8
+
9
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
10
+
11
+ ---
12
+
13
+ # v3.1.53 (Thu Nov 09 2023)
14
+
15
+ #### 🐛 Bug Fix
16
+
17
+ - Fix color swatch [#277](https://github.com/AppQuality/unguess-design-system/pull/277) ([@cannarocks](https://github.com/cannarocks) [@marcbon](https://github.com/marcbon) [@iDome89](https://github.com/iDome89))
18
+ - 🐛 fix(color-swatch): fix color selection bug in handleSelect function [#276](https://github.com/AppQuality/unguess-design-system/pull/276) ([@marcbon](https://github.com/marcbon))
19
+
20
+ #### Authors: 3
21
+
22
+ - [@iDome89](https://github.com/iDome89)
23
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
24
+ - Marco Bonomo ([@marcbon](https://github.com/marcbon))
25
+
26
+ ---
27
+
1
28
  # v3.1.52 (Wed Nov 08 2023)
2
29
 
3
30
  #### 🐛 Bug Fix
package/build/index.js CHANGED
@@ -2326,12 +2326,29 @@ const Trigger$1 = styled.styled.div `
2326
2326
  justify-content: flex-start;
2327
2327
  cursor: pointer;
2328
2328
  `;
2329
+ const StyledColorSwatchDialog = styled.styled(reactColorpickers.ColorSwatchDialog) `
2330
+ ${({ disableTooltip }) => disableTooltip &&
2331
+ `
2332
+ & div[role="tooltip"] {
2333
+ display: none;
2334
+ }`}
2335
+ `;
2329
2336
  const ColorSwatchTrigger = React__default["default"].forwardRef((props, ref) => {
2330
2337
  var _a;
2331
2338
  return (jsxRuntime.jsx(Trigger$1, Object.assign({ ref: ref }, props, { style: Object.assign(Object.assign({}, props.style), { color: props.color }) }, { children: (_a = props.children) !== null && _a !== void 0 ? _a : jsxRuntime.jsx(SvgCircleFullFill, {}) })));
2332
2339
  });
2333
- const ColorSwatch = ({ colors, rowSize, children, onSelect, }) => {
2334
- const matrix = containerUtilities.convertToMatrix(colors, rowSize !== null && rowSize !== void 0 ? rowSize : 7);
2340
+ const ColorSwatch = (_a) => {
2341
+ var { colors, rowSize, children, onSelect } = _a, props = __rest(_a, ["colors", "rowSize", "children", "onSelect"]);
2342
+ /**
2343
+ * Convert the colors to the format expected by the ColorSwatchDialog
2344
+ */
2345
+ const cleanedColors = colors.map(({ label, value }) => {
2346
+ return {
2347
+ value,
2348
+ label: label !== null && label !== void 0 ? label : "",
2349
+ };
2350
+ });
2351
+ const matrix = containerUtilities.convertToMatrix(cleanedColors, rowSize !== null && rowSize !== void 0 ? rowSize : 7);
2335
2352
  const [color, setColor] = React.useState(matrix[0][0].value);
2336
2353
  const [rowIndex, setRowIndex] = React.useState(0);
2337
2354
  const [colIndex, setColIndex] = React.useState(0);
@@ -2344,13 +2361,13 @@ const ColorSwatch = ({ colors, rowSize, children, onSelect, }) => {
2344
2361
  const handleSelect = (rowIdx, colIdx) => {
2345
2362
  setSelectedRowIndex(rowIdx);
2346
2363
  setSelectedColIndex(colIdx);
2347
- setColor(matrix[rowIdx][colIdx].value);
2348
2364
  };
2349
- return (jsxRuntime.jsx(reactColorpickers.ColorSwatchDialog, Object.assign({ colors: matrix, onChange: handleChange, onSelect: (rowIdx, colIdx) => {
2365
+ return (jsxRuntime.jsx(StyledColorSwatchDialog, Object.assign({ colors: matrix, onChange: handleChange, onSelect: (rowIdx, colIdx) => {
2350
2366
  handleSelect(rowIdx, colIdx);
2367
+ setColor(matrix[rowIdx][colIdx].value);
2351
2368
  if (onSelect)
2352
- onSelect(color);
2353
- }, rowIndex: rowIndex, colIndex: colIndex, selectedRowIndex: selectedRowIndex, selectedColIndex: selectedColIndex }, { children: jsxRuntime.jsx(ColorSwatchTrigger, Object.assign({ color: color }, { children: children })) })));
2369
+ onSelect(matrix[rowIdx][colIdx].value);
2370
+ }, rowIndex: rowIndex, colIndex: colIndex, selectedRowIndex: selectedRowIndex, selectedColIndex: selectedColIndex }, props, { children: jsxRuntime.jsx(ColorSwatchTrigger, Object.assign({ color: color }, { children: children })) })));
2354
2371
  };
2355
2372
 
2356
2373
  const UgDrawer = styled__default["default"](reactModals.DrawerModal) `
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ButtonArgs } from "./_types";
3
2
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
4
3
  export declare const Basic: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
@@ -8,18 +8,18 @@ export declare const variants: readonly [{}, {
8
8
  readonly disabled: true;
9
9
  }];
10
10
  export declare const Row: import("styled-components").IStyledComponent<"web", {
11
- alignItems?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
12
- alignItemsXs?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
13
- alignItemsSm?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
14
- alignItemsMd?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
15
- alignItemsLg?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
16
- alignItemsXl?: "center" | "start" | "end" | "baseline" | "stretch" | undefined;
17
- justifyContent?: "center" | "start" | "end" | "between" | "around" | undefined;
18
- justifyContentXs?: "center" | "start" | "end" | "between" | "around" | undefined;
19
- justifyContentSm?: "center" | "start" | "end" | "between" | "around" | undefined;
20
- justifyContentMd?: "center" | "start" | "end" | "between" | "around" | undefined;
21
- justifyContentLg?: "center" | "start" | "end" | "between" | "around" | undefined;
22
- justifyContentXl?: "center" | "start" | "end" | "between" | "around" | undefined;
11
+ alignItems?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
12
+ alignItemsXs?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
13
+ alignItemsSm?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
14
+ alignItemsMd?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
15
+ alignItemsLg?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
16
+ alignItemsXl?: "start" | "center" | "end" | "baseline" | "stretch" | undefined;
17
+ justifyContent?: "start" | "center" | "end" | "between" | "around" | undefined;
18
+ justifyContentXs?: "start" | "center" | "end" | "between" | "around" | undefined;
19
+ justifyContentSm?: "start" | "center" | "end" | "between" | "around" | undefined;
20
+ justifyContentMd?: "start" | "center" | "end" | "between" | "around" | undefined;
21
+ justifyContentLg?: "start" | "center" | "end" | "between" | "around" | undefined;
22
+ justifyContentXl?: "start" | "center" | "end" | "between" | "around" | undefined;
23
23
  wrap?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
24
24
  wrapXs?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
25
25
  wrapSm?: "wrap" | "nowrap" | "wrap-reverse" | undefined;
@@ -33,7 +33,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
33
33
  accessKey?: string | undefined;
34
34
  autoFocus?: boolean | undefined;
35
35
  className?: string | undefined;
36
- contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
36
+ contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
37
37
  contextMenu?: string | undefined;
38
38
  dir?: string | undefined;
39
39
  draggable?: (boolean | "true" | "false") | undefined;
@@ -73,7 +73,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
73
73
  results?: number | undefined;
74
74
  security?: string | undefined;
75
75
  unselectable?: "on" | "off" | undefined;
76
- inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
76
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
77
77
  is?: string | undefined;
78
78
  "aria-activedescendant"?: string | undefined;
79
79
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -84,7 +84,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
84
84
  "aria-colindex"?: number | undefined;
85
85
  "aria-colspan"?: number | undefined;
86
86
  "aria-controls"?: string | undefined;
87
- "aria-current"?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
87
+ "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
88
88
  "aria-describedby"?: string | undefined;
89
89
  "aria-details"?: string | undefined;
90
90
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
@@ -93,7 +93,7 @@ export declare const Row: import("styled-components").IStyledComponent<"web", {
93
93
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
94
94
  "aria-flowto"?: string | undefined;
95
95
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
96
- "aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
96
+ "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
97
97
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
98
98
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
99
99
  "aria-keyshortcuts"?: string | undefined;
@@ -299,18 +299,18 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
299
299
  md?: string | number | boolean | undefined;
300
300
  lg?: string | number | boolean | undefined;
301
301
  xl?: string | number | boolean | undefined;
302
- alignSelf?: "center" | "auto" | "start" | "end" | "baseline" | "stretch" | undefined;
303
- alignSelfXs?: "center" | "auto" | "start" | "end" | "baseline" | "stretch" | undefined;
304
- alignSelfSm?: "center" | "auto" | "start" | "end" | "baseline" | "stretch" | undefined;
305
- alignSelfMd?: "center" | "auto" | "start" | "end" | "baseline" | "stretch" | undefined;
306
- alignSelfLg?: "center" | "auto" | "start" | "end" | "baseline" | "stretch" | undefined;
307
- alignSelfXl?: "center" | "auto" | "start" | "end" | "baseline" | "stretch" | undefined;
308
- textAlign?: "center" | "start" | "end" | "justify" | undefined;
309
- textAlignXs?: "center" | "start" | "end" | "justify" | undefined;
310
- textAlignSm?: "center" | "start" | "end" | "justify" | undefined;
311
- textAlignMd?: "center" | "start" | "end" | "justify" | undefined;
312
- textAlignLg?: "center" | "start" | "end" | "justify" | undefined;
313
- textAlignXl?: "center" | "start" | "end" | "justify" | undefined;
302
+ alignSelf?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
303
+ alignSelfXs?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
304
+ alignSelfSm?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
305
+ alignSelfMd?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
306
+ alignSelfLg?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
307
+ alignSelfXl?: "start" | "center" | "end" | "baseline" | "stretch" | "auto" | undefined;
308
+ textAlign?: "start" | "center" | "end" | "justify" | undefined;
309
+ textAlignXs?: "start" | "center" | "end" | "justify" | undefined;
310
+ textAlignSm?: "start" | "center" | "end" | "justify" | undefined;
311
+ textAlignMd?: "start" | "center" | "end" | "justify" | undefined;
312
+ textAlignLg?: "start" | "center" | "end" | "justify" | undefined;
313
+ textAlignXl?: "start" | "center" | "end" | "justify" | undefined;
314
314
  offset?: string | number | undefined;
315
315
  offsetXs?: string | number | undefined;
316
316
  offsetSm?: string | number | undefined;
@@ -330,7 +330,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
330
330
  accessKey?: string | undefined;
331
331
  autoFocus?: boolean | undefined;
332
332
  className?: string | undefined;
333
- contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
333
+ contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
334
334
  contextMenu?: string | undefined;
335
335
  dir?: string | undefined;
336
336
  draggable?: (boolean | "true" | "false") | undefined;
@@ -370,7 +370,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
370
370
  results?: number | undefined;
371
371
  security?: string | undefined;
372
372
  unselectable?: "on" | "off" | undefined;
373
- inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
373
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
374
374
  is?: string | undefined;
375
375
  "aria-activedescendant"?: string | undefined;
376
376
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -381,7 +381,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
381
381
  "aria-colindex"?: number | undefined;
382
382
  "aria-colspan"?: number | undefined;
383
383
  "aria-controls"?: string | undefined;
384
- "aria-current"?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
384
+ "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
385
385
  "aria-describedby"?: string | undefined;
386
386
  "aria-details"?: string | undefined;
387
387
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
@@ -390,7 +390,7 @@ export declare const Col: import("styled-components").IStyledComponent<"web", {
390
390
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
391
391
  "aria-flowto"?: string | undefined;
392
392
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
393
- "aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
393
+ "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
394
394
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
395
395
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
396
396
  "aria-keyshortcuts"?: string | undefined;
@@ -600,7 +600,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
600
600
  accessKey?: string | undefined;
601
601
  autoFocus?: boolean | undefined;
602
602
  className?: string | undefined;
603
- contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
603
+ contentEditable?: (boolean | "true" | "false") | "inherit" | undefined;
604
604
  contextMenu?: string | undefined;
605
605
  dir?: string | undefined;
606
606
  draggable?: (boolean | "true" | "false") | undefined;
@@ -640,7 +640,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
640
640
  results?: number | undefined;
641
641
  security?: string | undefined;
642
642
  unselectable?: "on" | "off" | undefined;
643
- inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
643
+ inputMode?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
644
644
  is?: string | undefined;
645
645
  "aria-activedescendant"?: string | undefined;
646
646
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
@@ -651,7 +651,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
651
651
  "aria-colindex"?: number | undefined;
652
652
  "aria-colspan"?: number | undefined;
653
653
  "aria-controls"?: string | undefined;
654
- "aria-current"?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
654
+ "aria-current"?: boolean | "true" | "false" | "page" | "step" | "location" | "date" | "time" | undefined;
655
655
  "aria-describedby"?: string | undefined;
656
656
  "aria-details"?: string | undefined;
657
657
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
@@ -660,7 +660,7 @@ export declare const MD: import("styled-components").IStyledComponent<"web", {
660
660
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
661
661
  "aria-flowto"?: string | undefined;
662
662
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
663
- "aria-haspopup"?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
663
+ "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
664
664
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
665
665
  "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
666
666
  "aria-keyshortcuts"?: string | undefined;
@@ -1,12 +1,14 @@
1
1
  /// <reference types="react" />
2
- export interface ColorSwatchProps {
2
+ import { IColorSwatchDialogProps } from "@zendeskgarden/react-colorpickers";
3
+ export interface ColorSwatchProps extends Omit<IColorSwatchDialogProps, "colors" | "onSelect"> {
3
4
  colors: {
4
- label: string;
5
+ label?: string;
5
6
  value: string;
6
7
  }[];
7
8
  rowSize?: number;
8
9
  children?: React.ReactNode | React.ReactNode[];
9
10
  onSelect?: (color: string) => void;
11
+ disableTooltip?: boolean;
10
12
  }
11
13
  export interface ColorSwatchTriggerProps {
12
14
  style?: React.CSSProperties;
@@ -1,3 +1,3 @@
1
1
  import { ColorSwatchProps } from "./_types";
2
- declare const ColorSwatch: ({ colors, rowSize, children, onSelect, }: ColorSwatchProps) => import("react/jsx-runtime").JSX.Element;
2
+ declare const ColorSwatch: ({ colors, rowSize, children, onSelect, ...props }: ColorSwatchProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export { ColorSwatch };
@@ -1,4 +1,5 @@
1
1
  import { ColorSwatchProps } from "./_types";
2
2
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ColorSwatchProps>;
3
+ export declare const WithoutLabels: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ColorSwatchProps>;
3
4
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, ColorSwatchProps>;
4
5
  export default _default;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { DropdownArgs, SelectArgs } from "./_types";
3
2
  import { MenuArgs } from "../menu/_types";
4
3
  interface IItem {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { EditorArgs } from "./_types";
3
2
  interface EditorStoryArgs extends EditorArgs {
4
3
  children?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "3.1.52",
3
+ "version": "3.1.54",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -99,7 +99,7 @@
99
99
  "rollup": "~2.66",
100
100
  "rollup-plugin-typescript2": "^0.34.1",
101
101
  "storybook": "^7.0.9",
102
- "styled-components": "^6.0.0",
102
+ "styled-components": "^6.1.1",
103
103
  "typescript": "^4.5.0",
104
104
  "web-vitals": "^2.1.4"
105
105
  },
@@ -138,6 +138,6 @@
138
138
  "formik": "^2.2.9",
139
139
  "react": "^17.0.2",
140
140
  "react-dom": "^17.0.2",
141
- "styled-components": "^6.0.0"
141
+ "styled-components": "^6.1.1"
142
142
  }
143
143
  }