@appquality/unguess-design-system 3.1.51 → 3.1.53

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.53 (Thu Nov 09 2023)
2
+
3
+ #### 🐛 Bug Fix
4
+
5
+ - 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))
6
+ - 🐛 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))
7
+
8
+ #### Authors: 3
9
+
10
+ - [@iDome89](https://github.com/iDome89)
11
+ - Luca Cannarozzo ([@cannarocks](https://github.com/cannarocks))
12
+ - Marco Bonomo ([@marcbon](https://github.com/marcbon))
13
+
14
+ ---
15
+
16
+ # v3.1.52 (Wed Nov 08 2023)
17
+
18
+ #### 🐛 Bug Fix
19
+
20
+ - 🔀 chore(color-swatch): update import statement for ColorSwatch component [#275](https://github.com/AppQuality/unguess-design-system/pull/275) ([@marcbon](https://github.com/marcbon))
21
+
22
+ #### Authors: 1
23
+
24
+ - Marco Bonomo ([@marcbon](https://github.com/marcbon))
25
+
26
+ ---
27
+
1
28
  # v3.1.51 (Wed Nov 08 2023)
2
29
 
3
30
  #### 🐛 Bug Fix
package/build/index.js CHANGED
@@ -24,8 +24,8 @@ var pie = require('@nivo/pie');
24
24
  var sunburst = require('@nivo/sunburst');
25
25
  var waffle = require('@nivo/waffle');
26
26
  var line = require('@nivo/line');
27
- require('@zendeskgarden/container-utilities');
28
- require('@zendeskgarden/react-colorpickers');
27
+ var containerUtilities = require('@zendeskgarden/container-utilities');
28
+ var reactColorpickers = require('@zendeskgarden/react-colorpickers');
29
29
  var reactModals = require('@zendeskgarden/react-modals');
30
30
  var reactDropdowns = require('@zendeskgarden/react-dropdowns');
31
31
  var reactForms = require('@zendeskgarden/react-forms');
@@ -2326,10 +2326,49 @@ const Trigger$1 = styled.styled.div `
2326
2326
  justify-content: flex-start;
2327
2327
  cursor: pointer;
2328
2328
  `;
2329
- React__default["default"].forwardRef((props, ref) => {
2329
+ const StyledColorSwatchDialog = styled.styled(reactColorpickers.ColorSwatchDialog) `
2330
+ ${({ disableTooltip }) => disableTooltip &&
2331
+ `
2332
+ & div[role="tooltip"] {
2333
+ display: none;
2334
+ }`}
2335
+ `;
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
+ });
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);
2352
+ const [color, setColor] = React.useState(matrix[0][0].value);
2353
+ const [rowIndex, setRowIndex] = React.useState(0);
2354
+ const [colIndex, setColIndex] = React.useState(0);
2355
+ const [selectedRowIndex, setSelectedRowIndex] = React.useState(0);
2356
+ const [selectedColIndex, setSelectedColIndex] = React.useState(0);
2357
+ const handleChange = (rowIdx, colIdx) => {
2358
+ setRowIndex(rowIdx);
2359
+ setColIndex(colIdx);
2360
+ };
2361
+ const handleSelect = (rowIdx, colIdx) => {
2362
+ setSelectedRowIndex(rowIdx);
2363
+ setSelectedColIndex(colIdx);
2364
+ };
2365
+ return (jsxRuntime.jsx(StyledColorSwatchDialog, Object.assign({ colors: matrix, onChange: handleChange, onSelect: (rowIdx, colIdx) => {
2366
+ handleSelect(rowIdx, colIdx);
2367
+ setColor(matrix[rowIdx][colIdx].value);
2368
+ if (onSelect)
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 })) })));
2371
+ };
2333
2372
 
2334
2373
  const UgDrawer = styled__default["default"](reactModals.DrawerModal) `
2335
2374
  @media (max-width: ${({ theme }) => theme.breakpoints.sm}) {
@@ -5796,6 +5835,7 @@ exports.Chrome = Chrome;
5796
5835
  exports.Close = Close;
5797
5836
  exports.Code = Code;
5798
5837
  exports.Col = Col;
5838
+ exports.ColorSwatch = ColorSwatch;
5799
5839
  exports.ContainerCard = ContainerCard;
5800
5840
  exports.Content = Content$1;
5801
5841
  exports.CounterMultiselect = CounterMultiselect;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ButtonArgs } from "./_types";
2
3
  export declare const Default: import("@storybook/types").AnnotatedStoryFn<import("@storybook/react/dist/types-0a347bb9").R, ButtonArgs>;
3
4
  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?: "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;
11
+ alignItems?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
12
+ alignItemsXs?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
13
+ alignItemsSm?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
14
+ alignItemsMd?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
15
+ alignItemsLg?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
16
+ alignItemsXl?: "end" | "start" | "center" | "baseline" | "stretch" | undefined;
17
+ justifyContent?: "end" | "start" | "center" | "between" | "around" | undefined;
18
+ justifyContentXs?: "end" | "start" | "center" | "between" | "around" | undefined;
19
+ justifyContentSm?: "end" | "start" | "center" | "between" | "around" | undefined;
20
+ justifyContentMd?: "end" | "start" | "center" | "between" | "around" | undefined;
21
+ justifyContentLg?: "end" | "start" | "center" | "between" | "around" | undefined;
22
+ justifyContentXl?: "end" | "start" | "center" | "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;
@@ -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?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
76
+ inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
77
77
  is?: string | undefined;
78
78
  "aria-activedescendant"?: string | undefined;
79
79
  "aria-atomic"?: (boolean | "true" | "false") | 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?: "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;
302
+ alignSelf?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
303
+ alignSelfXs?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
304
+ alignSelfSm?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
305
+ alignSelfMd?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
306
+ alignSelfLg?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
307
+ alignSelfXl?: "auto" | "end" | "start" | "center" | "baseline" | "stretch" | undefined;
308
+ textAlign?: "end" | "start" | "center" | "justify" | undefined;
309
+ textAlignXs?: "end" | "start" | "center" | "justify" | undefined;
310
+ textAlignSm?: "end" | "start" | "center" | "justify" | undefined;
311
+ textAlignMd?: "end" | "start" | "center" | "justify" | undefined;
312
+ textAlignLg?: "end" | "start" | "center" | "justify" | undefined;
313
+ textAlignXl?: "end" | "start" | "center" | "justify" | undefined;
314
314
  offset?: string | number | undefined;
315
315
  offsetXs?: string | number | undefined;
316
316
  offsetSm?: string | number | 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?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
373
+ inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
374
374
  is?: string | undefined;
375
375
  "aria-activedescendant"?: string | undefined;
376
376
  "aria-atomic"?: (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?: "decimal" | "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | undefined;
643
+ inputMode?: "none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
644
644
  is?: string | undefined;
645
645
  "aria-activedescendant"?: string | undefined;
646
646
  "aria-atomic"?: (boolean | "true" | "false") | 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;
3
- export default ColorSwatch;
2
+ declare const ColorSwatch: ({ colors, rowSize, children, onSelect, ...props }: ColorSwatchProps) => import("react/jsx-runtime").JSX.Element;
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,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { DropdownArgs, SelectArgs } from "./_types";
2
3
  import { MenuArgs } from "../menu/_types";
3
4
  interface IItem {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { EditorArgs } from "./_types";
2
3
  interface EditorStoryArgs extends EditorArgs {
3
4
  children?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appquality/unguess-design-system",
3
- "version": "3.1.51",
3
+ "version": "3.1.53",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",