@helpdice/ui 2.1.9 → 2.2.3

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.
@@ -2720,7 +2720,7 @@ function PhoneInput(_ref) {
2720
2720
  height: "20",
2721
2721
  src: "https://flagcdn.com/w20/".concat(selectedCountry.code.toLowerCase(), ".png"),
2722
2722
  srcSet: "https://flagcdn.com/w40/".concat(selectedCountry.code.toLowerCase(), ".png 2x"),
2723
- alt: "Flag of ".concat(selectedCountry.label),
2723
+ alt: "".concat(selectedCountry.label, " Flag"),
2724
2724
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2725
2725
  }), /*#__PURE__*/React.createElement("span", {
2726
2726
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
@@ -2768,7 +2768,7 @@ function PhoneInput(_ref) {
2768
2768
  height: "23",
2769
2769
  src: "https://flagcdn.com/w20/".concat(c.code.toLowerCase(), ".png"),
2770
2770
  srcSet: "https://flagcdn.com/w40/".concat(c.code.toLowerCase(), ".png 2x"),
2771
- alt: "Flag of ".concat(c.label),
2771
+ alt: "".concat(c.label, " Flag"),
2772
2772
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2773
2773
  }), c.phone, " ", /*#__PURE__*/React.createElement("span", {
2774
2774
  style: {
@@ -903,7 +903,7 @@ var withScale = function withScale(Render) {
903
903
  return ScaleFC;
904
904
  };
905
905
 
906
- var _excluded = ["type", "className", "icon", "count", "value", "initialValue", "onValueChange", "locked", "onLockedChange"];
906
+ var _excluded = ["color", "className", "icon", "count", "value", "initialValue", "onValueChange", "locked", "onLockedChange"];
907
907
  tupleNumber(2, 3, 4, 5, 6, 7, 8, 9, 10);
908
908
  tupleNumber(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
909
909
  var getColor = function getColor(type, palette) {
@@ -916,8 +916,8 @@ var getColor = function getColor(type, palette) {
916
916
  return colors[type] || colors["default"];
917
917
  };
918
918
  var RatingComponent = function RatingComponent(_ref) {
919
- var _ref$type = _ref.type,
920
- type = _ref$type === void 0 ? 'default' : _ref$type,
919
+ var _ref$color = _ref.color,
920
+ _color = _ref$color === void 0 ? 'default' : _ref$color,
921
921
  _ref$className = _ref.className,
922
922
  className = _ref$className === void 0 ? '' : _ref$className,
923
923
  _ref$icon = _ref.icon,
@@ -936,8 +936,8 @@ var RatingComponent = function RatingComponent(_ref) {
936
936
  var _useScale = useScale(),
937
937
  SCALES = _useScale.SCALES;
938
938
  var color = React.useMemo(function () {
939
- return getColor(type, theme$1.palette);
940
- }, [type, theme$1.palette]);
939
+ return getColor(_color, theme$1.palette);
940
+ }, [_color, theme$1.palette]);
941
941
  var _useState = React.useState(initialValue),
942
942
  _useState2 = _slicedToArray(_useState, 2),
943
943
  value = _useState2[0],
@@ -6,7 +6,7 @@ declare const ratingValueTuple: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
6
6
  export type RatingValue = typeof ratingValueTuple[number];
7
7
  export type RatingCount = typeof ratingCountTuple[number];
8
8
  interface Props {
9
- type?: RatingTypes;
9
+ color?: RatingTypes;
10
10
  className?: string;
11
11
  icon?: JSX.Element;
12
12
  count?: RatingCount | number;
@@ -2766,7 +2766,7 @@ function PhoneInput(_ref) {
2766
2766
  height: "20",
2767
2767
  src: "https://flagcdn.com/w20/".concat(selectedCountry.code.toLowerCase(), ".png"),
2768
2768
  srcSet: "https://flagcdn.com/w40/".concat(selectedCountry.code.toLowerCase(), ".png 2x"),
2769
- alt: "Flag of ".concat(selectedCountry.label),
2769
+ alt: "".concat(selectedCountry.label, " Flag"),
2770
2770
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2771
2771
  }), /*#__PURE__*/React.createElement("span", {
2772
2772
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
@@ -2814,7 +2814,7 @@ function PhoneInput(_ref) {
2814
2814
  height: "23",
2815
2815
  src: "https://flagcdn.com/w20/".concat(c.code.toLowerCase(), ".png"),
2816
2816
  srcSet: "https://flagcdn.com/w40/".concat(c.code.toLowerCase(), ".png 2x"),
2817
- alt: "Flag of ".concat(c.label),
2817
+ alt: "".concat(c.label, " Flag"),
2818
2818
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme$1.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme$1.type == 'dark' ? '#3a3d3d' : '#efefef']]])
2819
2819
  }), c.phone, " ", /*#__PURE__*/React.createElement("span", {
2820
2820
  style: {
@@ -22707,6 +22707,7 @@ var TableCell = function TableCell(_ref) {
22707
22707
  onCellClick = _ref.onCellClick;
22708
22708
  /* eslint-disable react/jsx-no-useless-fragment */
22709
22709
  return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
22710
+ var _row$_id;
22710
22711
  var currentRowValue = row[column.prop];
22711
22712
  var cellValue = currentRowValue || emptyText;
22712
22713
  var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
@@ -22721,7 +22722,7 @@ var TableCell = function TableCell(_ref) {
22721
22722
  whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
22722
22723
  }, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
22723
22724
  "data-column": column.prop,
22724
- key: "row-td-".concat(currentRowValue.id, "-").concat(column.prop.toString()),
22725
+ key: "row-td-".concat((_row$_id = row === null || row === void 0 ? void 0 : row._id) !== null && _row$_id !== void 0 ? _row$_id : 'col', "-").concat(column.prop.toString()),
22725
22726
  onClick: function onClick() {
22726
22727
  return onCellClick && onCellClick(currentRowValue, rowIndex, index);
22727
22728
  },
@@ -1,3 +1,4 @@
1
- export { default as Carousel } from './component';
1
+ import Carousel from './component';
2
2
  export type { CarouselProps } from './component/types';
3
3
  export { default as Thumbs } from './component/Thumbs';
4
+ export default Carousel;
@@ -1,2 +1,3 @@
1
- export { default as Carousel } from './component';
2
- export { default as Thumbs } from './component/Thumbs';
1
+ import Carousel from './component';
2
+ export { default as Thumbs } from './component/Thumbs';
3
+ export default Carousel;
@@ -1,12 +1,19 @@
1
+ import React from "react";
1
2
  declare const wrap: ["nowrap", "wrap", "wrap-reverse"];
2
3
  export type Wrap = typeof wrap[number];
3
- type ContainerProps = {
4
+ type Props = {
4
5
  gap?: number;
6
+ direction?: string;
5
7
  children?: React.ReactNode;
8
+ justify?: string;
9
+ alignItems?: string;
10
+ alignContent?: string;
6
11
  wrap?: Wrap;
7
12
  className?: string;
8
13
  };
9
- declare const _default: import("react").ForwardRefExoticComponent<ContainerProps & {
14
+ type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
15
+ export type ContainerProps = Props & NativeAttrs;
16
+ declare const _default: React.ForwardRefExoticComponent<Props & NativeAttrs & {
10
17
  width?: string | number;
11
18
  height?: string | number;
12
19
  padding?: string | number;
@@ -38,5 +45,5 @@ declare const _default: import("react").ForwardRefExoticComponent<ContainerProps
38
45
  scale?: number;
39
46
  children?: any;
40
47
  className?: string;
41
- } & import("react").InputHTMLAttributes<any> & import("react").RefAttributes<unknown>>;
48
+ } & React.InputHTMLAttributes<any> & React.RefAttributes<unknown>>;
42
49
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
- var _excluded = ["gap", "children", "className"];
3
+ var _excluded = ["gap", "children", "direction", "justify", "alignItems", "alignContent", "className"];
4
4
  import _JSXStyle from "../styled-jsx.es.js";
5
+ import React, { useMemo } from "react";
5
6
  import GridBasicItem from "../grid/basic-item";
6
7
  import useScale, { withScale } from '../use-scale';
7
- import { useMemo } from "react";
8
8
  import { useClasses } from '@helpdice/theme';
9
9
  import { tuple } from '../utils/prop-types';
10
10
  var wrap = tuple('nowrap', 'wrap', 'wrap-reverse');
@@ -12,6 +12,10 @@ var Container = function Container(_ref) {
12
12
  var _ref$gap = _ref.gap,
13
13
  gap = _ref$gap === void 0 ? 0 : _ref$gap,
14
14
  children = _ref.children,
15
+ direction = _ref.direction,
16
+ justify = _ref.justify,
17
+ alignItems = _ref.alignItems,
18
+ alignContent = _ref.alignContent,
15
19
  _ref$className = _ref.className,
16
20
  className = _ref$className === void 0 ? '' : _ref$className,
17
21
  props = _objectWithoutProperties(_ref, _excluded);
@@ -23,10 +27,10 @@ var Container = function Container(_ref) {
23
27
  }, [gap, unit]);
24
28
  var _styles$className = {
25
29
  styles: /*#__PURE__*/React.createElement(_JSXStyle, {
26
- id: "2955470113",
27
- dynamic: [gapUnit, wrap, SCALES.width(1, 'var(--container-width)')]
28
- }, "div.__jsx-style-dynamic-selector{--gap-unit:".concat(gapUnit, ";--container-width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";box-sizing:border-box;gap:var(--gap-unit);width:").concat(SCALES.width(1, 'var(--container-width)'), ";}")),
29
- className: _JSXStyle.dynamic([["2955470113", [gapUnit, wrap, SCALES.width(1, 'var(--container-width)')]]])
30
+ id: "4110955330",
31
+ dynamic: [gapUnit, direction, wrap, justify, alignContent, alignItems, SCALES.width(1, 'var(--container-width)'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
32
+ }, "div.__jsx-style-dynamic-selector{--gap-unit:".concat(gapUnit, ";--container-width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:").concat(direction, ";-ms-flex-direction:").concat(direction, ";flex-direction:").concat(direction, ";-webkit-flex-wrap:").concat(wrap, ";-ms-flex-wrap:").concat(wrap, ";flex-wrap:").concat(wrap, ";-webkit-box-pack:").concat(justify, ";-webkit-justify-content:").concat(justify, ";-ms-flex-pack:").concat(justify, ";justify-content:").concat(justify, ";-webkit-align-content:").concat(alignContent, ";-ms-flex-line-pack:").concat(alignContent, ";align-content:").concat(alignContent, ";-webkit-align-items:").concat(alignItems, ";-webkit-box-align:").concat(alignItems, ";-ms-flex-align:").concat(alignItems, ";align-items:").concat(alignItems, ";box-sizing:border-box;gap:var(--gap-unit);width:").concat(SCALES.width(1, 'var(--container-width)'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}")),
33
+ className: _JSXStyle.dynamic([["4110955330", [gapUnit, direction, wrap, justify, alignContent, alignItems, SCALES.width(1, 'var(--container-width)'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
30
34
  },
31
35
  resolveClassName = _styles$className.className,
32
36
  styles = _styles$className.styles;
@@ -1,14 +1,16 @@
1
1
  import React from 'react';
2
- type ClipboardProps = {
2
+ type Props = {
3
3
  showIcon: boolean;
4
4
  text: string;
5
5
  children: React.ReactNode;
6
- onCopy: (text: string, result: any) => void;
7
- options: {
6
+ onCopy?: (text: string, result: any) => void;
7
+ options?: {
8
8
  debug: boolean;
9
9
  message: string;
10
10
  format: string;
11
11
  };
12
12
  };
13
+ type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
14
+ export type ClipboardProps = Props & NativeAttrs;
13
15
  export default function Clipboard(props: ClipboardProps): React.JSX.Element;
14
16
  export {};
@@ -4,6 +4,7 @@ import copy from './copy';
4
4
  import { Copy } from '@helpdice/icons';
5
5
  import Button from '../button';
6
6
  import { useToasts } from '@helpdice/theme';
7
+
7
8
  // export function Clipboard(props: ClipboardProps) {
8
9
  // const { setToast } = useToasts();
9
10
  // const { showIcon, text, onCopy, options: options, children, } = props;
package/esm/index.d.ts CHANGED
@@ -123,7 +123,7 @@ export { default as Skeleton } from './skeleton';
123
123
  export * from './login-with';
124
124
  export { default as Swipe } from './swipe';
125
125
  export type { SwipeProps } from './swipe';
126
- export { Carousel } from './carousal';
126
+ export { default as Carousel } from './carousal';
127
127
  export type { CarouselProps } from './carousal';
128
128
  export type { CurrencyInputProps, CurrencyInputOnChangeValues } from './input/currency-input';
129
129
  export { default as useToasts } from './use-toasts';
package/esm/index.js CHANGED
@@ -83,7 +83,7 @@ export * from './login-with';
83
83
  // Swipe
84
84
  export { default as Swipe } from './swipe';
85
85
  // Carousel
86
- export { Carousel } from './carousal';
86
+ export { default as Carousel } from './carousal';
87
87
 
88
88
  // Currency Input
89
89
 
@@ -99,7 +99,7 @@ function PhoneInput(_ref) {
99
99
  height: "20",
100
100
  src: "https://flagcdn.com/w20/".concat(selectedCountry.code.toLowerCase(), ".png"),
101
101
  srcSet: "https://flagcdn.com/w40/".concat(selectedCountry.code.toLowerCase(), ".png 2x"),
102
- alt: "Flag of ".concat(selectedCountry.label),
102
+ alt: "".concat(selectedCountry.label, " Flag"),
103
103
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
104
104
  }), /*#__PURE__*/React.createElement("span", {
105
105
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
@@ -147,7 +147,7 @@ function PhoneInput(_ref) {
147
147
  height: "23",
148
148
  src: "https://flagcdn.com/w20/".concat(c.code.toLowerCase(), ".png"),
149
149
  srcSet: "https://flagcdn.com/w40/".concat(c.code.toLowerCase(), ".png 2x"),
150
- alt: "Flag of ".concat(c.label),
150
+ alt: "".concat(c.label, " Flag"),
151
151
  className: _JSXStyle.dynamic([["3237870810", [SCALES.width(1, defaultWidth), SCALES.height(2.25), hoverBorder, borderColor, borderColor, SCALES.width(1, defaultWidth), theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
152
152
  }), c.phone, " ", /*#__PURE__*/React.createElement("span", {
153
153
  style: {
@@ -6,7 +6,7 @@ declare const ratingValueTuple: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
6
6
  export type RatingValue = typeof ratingValueTuple[number];
7
7
  export type RatingCount = typeof ratingCountTuple[number];
8
8
  interface Props {
9
- type?: RatingTypes;
9
+ color?: RatingTypes;
10
10
  className?: string;
11
11
  icon?: JSX.Element;
12
12
  count?: RatingCount | number;
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
2
2
  import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
3
3
  import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
5
- var _excluded = ["type", "className", "icon", "count", "value", "initialValue", "onValueChange", "locked", "onLockedChange"];
5
+ var _excluded = ["color", "className", "icon", "count", "value", "initialValue", "onValueChange", "locked", "onLockedChange"];
6
6
  import _JSXStyle from "../styled-jsx.es.js";
7
7
  /* "use client" */
8
8
 
@@ -23,8 +23,8 @@ var getColor = function getColor(type, palette) {
23
23
  return colors[type] || colors["default"];
24
24
  };
25
25
  var RatingComponent = function RatingComponent(_ref) {
26
- var _ref$type = _ref.type,
27
- type = _ref$type === void 0 ? 'default' : _ref$type,
26
+ var _ref$color = _ref.color,
27
+ _color = _ref$color === void 0 ? 'default' : _ref$color,
28
28
  _ref$className = _ref.className,
29
29
  className = _ref$className === void 0 ? '' : _ref$className,
30
30
  _ref$icon = _ref.icon,
@@ -43,8 +43,8 @@ var RatingComponent = function RatingComponent(_ref) {
43
43
  var _useScale = useScale(),
44
44
  SCALES = _useScale.SCALES;
45
45
  var color = useMemo(function () {
46
- return getColor(type, theme.palette);
47
- }, [type, theme.palette]);
46
+ return getColor(_color, theme.palette);
47
+ }, [_color, theme.palette]);
48
48
  var _useState = useState(initialValue),
49
49
  _useState2 = _slicedToArray(_useState, 2),
50
50
  value = _useState2[0],
@@ -8,6 +8,7 @@ var TableCell = function TableCell(_ref) {
8
8
  onCellClick = _ref.onCellClick;
9
9
  /* eslint-disable react/jsx-no-useless-fragment */
10
10
  return /*#__PURE__*/React.createElement(React.Fragment, null, columns.map(function (column, index) {
11
+ var _row$_id;
11
12
  var currentRowValue = row[column.prop];
12
13
  var cellValue = currentRowValue || emptyText;
13
14
  var shouldBeRenderElement = column.renderHandler(currentRowValue, row, rowIndex);
@@ -22,7 +23,7 @@ var TableCell = function TableCell(_ref) {
22
23
  whiteSpace: column !== null && column !== void 0 && column.noWrap ? 'nowrap' : 'normal'
23
24
  }, currentRowValue === null || currentRowValue === void 0 ? void 0 : currentRowValue.style),
24
25
  "data-column": column.prop,
25
- key: "row-td-".concat(currentRowValue.id, "-").concat(column.prop.toString()),
26
+ key: "row-td-".concat((_row$_id = row === null || row === void 0 ? void 0 : row._id) !== null && _row$_id !== void 0 ? _row$_id : 'col', "-").concat(column.prop.toString()),
26
27
  onClick: function onClick() {
27
28
  return onCellClick && onCellClick(currentRowValue, rowIndex, index);
28
29
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/ui",
3
- "version": "2.1.9",
3
+ "version": "2.2.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",
@@ -63,8 +63,9 @@
63
63
  "@babel/preset-typescript": "^7.14.5",
64
64
  "@babel/standalone": "^7.28.3",
65
65
  "@helpdice/icons": "^1.2.5",
66
- "@helpdice/sdk": "^0.2.9",
66
+ "@helpdice/sdk": "^0.3.3",
67
67
  "@helpdice/utils": "^0.1.4",
68
+ "@helpdice/pro": "2.0.1",
68
69
  "@mapbox/rehype-prism": "^0.9.0",
69
70
  "@mdx-js/loader": "^3.1.0",
70
71
  "@mdx-js/react": "^3.1.0",