@vygruppen/spor-react 13.0.2 → 13.0.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.
@@ -1,28 +1,28 @@
1
1
 
2
- > @vygruppen/spor-react@13.0.2 build /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.0.3 build /home/runner/work/spor/spor/packages/spor-react
3
3
  > tsup
4
4
 
5
- CLI Building entry: src/index.tsx, src/icons/index.tsx
6
- CLI Using tsconfig: tsconfig.json
7
- CLI tsup v7.3.0
8
- CLI Using tsup config: /home/runner/work/spor/spor/packages/spor-react/tsup.config.ts
9
- CLI Target: node16
10
- CLI Cleaning output folder
11
- ESM Build start
12
- CJS Build start
13
- DTS Build start
14
- CJS dist/index.cjs 356.43 KB
15
- CJS dist/icons/index.cjs 381.00 B
16
- CJS dist/index.cjs.map 708.66 KB
17
- CJS dist/icons/index.cjs.map 157.00 B
18
- CJS ⚡️ Build success in 2510ms
19
- ESM dist/index.mjs 332.54 KB
20
- ESM dist/icons/index.mjs 110.00 B
21
- ESM dist/index.mjs.map 708.66 KB
22
- ESM dist/icons/index.mjs.map 157.00 B
23
- ESM ⚡️ Build success in 2510ms
24
- DTS ⚡️ Build success in 19366ms
25
- DTS dist/icons/index.d.ts 44.00 B
26
- DTS dist/index.d.ts 143.13 KB
27
- DTS dist/icons/index.d.cts 44.00 B
28
- DTS dist/index.d.cts 143.13 KB
5
+ CLI Building entry: src/index.tsx, src/icons/index.tsx
6
+ CLI Using tsconfig: tsconfig.json
7
+ CLI tsup v7.3.0
8
+ CLI Using tsup config: /home/runner/work/spor/spor/packages/spor-react/tsup.config.ts
9
+ CLI Target: node16
10
+ CLI Cleaning output folder
11
+ ESM Build start
12
+ CJS Build start
13
+ DTS Build start
14
+ CJS dist/index.cjs 360.47 KB
15
+ CJS dist/icons/index.cjs 381.00 B
16
+ CJS dist/index.cjs.map 716.33 KB
17
+ CJS dist/icons/index.cjs.map 157.00 B
18
+ CJS ⚡️ Build success in 3000ms
19
+ ESM dist/index.mjs 336.37 KB
20
+ ESM dist/icons/index.mjs 110.00 B
21
+ ESM dist/index.mjs.map 716.33 KB
22
+ ESM dist/icons/index.mjs.map 157.00 B
23
+ ESM ⚡️ Build success in 3001ms
24
+ DTS ⚡️ Build success in 22707ms
25
+ DTS dist/icons/index.d.ts 44.00 B
26
+ DTS dist/index.d.ts 143.54 KB
27
+ DTS dist/icons/index.d.cts 44.00 B
28
+ DTS dist/index.d.cts 143.54 KB
@@ -1,21 +1,22 @@
1
1
 
2
- > @vygruppen/spor-react@13.0.2 postinstall /home/runner/work/spor/spor/packages/spor-react
2
+ > @vygruppen/spor-react@13.0.3 postinstall /home/runner/work/spor/spor/packages/spor-react
3
3
  > chakra typegen src/theme/index.ts
4
4
 
5
- [dotenv@17.3.1] injecting env (0) from .env -- tip: ⚙️ suppress all logs with { quiet: true }
5
+ injected env (0) from .env // tip: encrypted .env [www.dotenvx.com]
6
6
  ┌ Chakra CLI ⚡️
7
7
  [?25l│
8
- ◇ Generated conditions typings
8
+ ◒ Generating conditions types...
9
+ ◇ ✅ Generated conditions typings
9
10
  [?25h[?25l│
10
11
  ◒ Generating recipe types...
11
- ◇ ✅ Generated recipe typings
12
+ ◇ ✅ Generated recipe typings
12
13
  [?25h[?25l│
13
14
  ◇ ✅ Generated utility typings
14
15
  [?25h[?25l│
15
16
  ◇ ✅ Generated token typings
16
17
  [?25h[?25l│
17
18
  ◒ Generating system types...
18
- ◇ ✅ Generated system types
19
+ ◇ ✅ Generated system types
19
20
  [?25h│
20
21
  └ 🎉 Done!
21
22
 
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @vygruppen/spor-react
2
2
 
3
+ ## 13.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - d10648c: Add InputChip component, and style adjustments to Select
8
+
3
9
  ## 13.0.2
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -3953,6 +3953,19 @@ var FieldsetLegend = react.Fieldset.Legend;
3953
3953
  var FieldsetContent = react.Fieldset.Content;
3954
3954
  var FieldsetHelperText = react.Fieldset.HelperText;
3955
3955
  var FieldsetErrorText = react.Fieldset.ErrorText;
3956
+ var InputChip = ({
3957
+ startIcon,
3958
+ endIcon,
3959
+ children,
3960
+ ref,
3961
+ ...rest
3962
+ }) => {
3963
+ return /* @__PURE__ */ jsxRuntime.jsxs(react.Tag.Root, { ref, ...rest, as: "button", children: [
3964
+ startIcon && /* @__PURE__ */ jsxRuntime.jsx(react.Tag.StartElement, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: startIcon }) }),
3965
+ /* @__PURE__ */ jsxRuntime.jsx(react.Tag.Label, { children }),
3966
+ endIcon && /* @__PURE__ */ jsxRuntime.jsx(react.Tag.EndElement, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Box, { as: endIcon }) })
3967
+ ] });
3968
+ };
3956
3969
  var ListBox = (props) => {
3957
3970
  const { loading, listBoxRef, state, maxWidth, variant, children } = props;
3958
3971
  const { listBoxProps } = reactAria.useListBox(props, state, listBoxRef);
@@ -4790,7 +4803,7 @@ var Select = ({
4790
4803
  css: styles.root,
4791
4804
  position: "relative",
4792
4805
  children: [
4793
- /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { "data-attachable": true, children: /* @__PURE__ */ jsxRuntime.jsx(SelectValueText, { withPlaceholder: label ? true : false }) }),
4806
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { "data-attachable": true, children: /* @__PURE__ */ jsxRuntime.jsx(SelectValueText, { withPlaceholder: !!label }) }),
4794
4807
  label && /* @__PURE__ */ jsxRuntime.jsx(SelectLabel, { css: styles.label, children: label }),
4795
4808
  /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { css: styles.selectContent, baseStyle: css, children })
4796
4809
  ]
@@ -4805,7 +4818,7 @@ var SelectLabel = (props) => {
4805
4818
  react.Select.Label,
4806
4819
  {
4807
4820
  ...props,
4808
- "data-selected": value.length > 0 ? true : void 0
4821
+ "data-selected": value.length > 0 || void 0
4809
4822
  }
4810
4823
  );
4811
4824
  };
@@ -4816,14 +4829,19 @@ var SelectItem = ({
4816
4829
  const { item, children, description, ...rest } = props;
4817
4830
  const recipe = react.useSlotRecipe({ key: "select" });
4818
4831
  const styles = recipe();
4832
+ const selectContext = react.useSelectContext();
4833
+ const multiple = selectContext.multiple;
4834
+ const isSelected = selectContext.value.includes(item.value);
4819
4835
  return /* @__PURE__ */ jsxRuntime.jsxs(react.Select.Item, { item, ...rest, ref, css: styles.item, children: [
4836
+ multiple && /* @__PURE__ */ jsxRuntime.jsx(react.Checkbox.Root, { checked: isSelected, pointerEvents: "none", children: /* @__PURE__ */ jsxRuntime.jsx(react.Checkbox.Control, { children: /* @__PURE__ */ jsxRuntime.jsx(react.Checkbox.Indicator, {}) }) }),
4820
4837
  /* @__PURE__ */ jsxRuntime.jsxs(react.Box, { width: "100%", children: [
4821
4838
  /* @__PURE__ */ jsxRuntime.jsx(react.Select.ItemText, { display: "flex", children }),
4822
4839
  description && /* @__PURE__ */ jsxRuntime.jsx(react.Box, { "data-part": "item-description", css: styles.itemDescription, children: description })
4823
4840
  ] }),
4824
- /* @__PURE__ */ jsxRuntime.jsx(react.Select.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(spor_icon_react_star.CheckmarkFill18Icon, {}) })
4841
+ !multiple && /* @__PURE__ */ jsxRuntime.jsx(react.Select.ItemIndicator, { children: /* @__PURE__ */ jsxRuntime.jsx(spor_icon_react_star.CheckmarkFill18Icon, {}) })
4825
4842
  ] });
4826
4843
  };
4844
+ SelectItem.displayName = "SelectItem";
4827
4845
  var SelectItemGroup = function SelectItemGroup2({
4828
4846
  ref,
4829
4847
  ...props
@@ -4882,6 +4900,8 @@ var SelectValueText = function SelectValueText2({
4882
4900
  ...props
4883
4901
  }) {
4884
4902
  const { children, withPlaceholder, placeholder, ...rest } = props;
4903
+ const selectContext = react.useSelectContext();
4904
+ const multiple = selectContext.multiple;
4885
4905
  return /* @__PURE__ */ jsxRuntime.jsx(
4886
4906
  react.Select.ValueText,
4887
4907
  {
@@ -4895,9 +4915,20 @@ var SelectValueText = function SelectValueText2({
4895
4915
  return placeholder;
4896
4916
  if (children)
4897
4917
  return children(items);
4898
- if (items.length === 1)
4918
+ if (multiple) {
4919
+ return /* @__PURE__ */ jsxRuntime.jsx(react.Flex, { gap: 0.5, marginBottom: 1, children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsx(
4920
+ Badge,
4921
+ {
4922
+ size: "sm",
4923
+ colorPalette: "green",
4924
+ children: select.collection.stringifyItem(item)
4925
+ },
4926
+ select.collection.stringifyItem(item)
4927
+ )) });
4928
+ }
4929
+ if (items.length === 1) {
4899
4930
  return select.collection.stringifyItem(items[0]);
4900
- return `${items.length} selected`;
4931
+ }
4901
4932
  } })
4902
4933
  }
4903
4934
  );
@@ -7789,6 +7820,7 @@ var comboboxAnatomy = react$1.comboboxAnatomy.extendWith(
7789
7820
  "indicatorGroup",
7790
7821
  "empty"
7791
7822
  );
7823
+ var tagAnatomy = anatomy.createAnatomy("tag").parts("root");
7792
7824
  var menuAnatomy = anatomy.createAnatomy("menu").parts(
7793
7825
  "trigger",
7794
7826
  "content",
@@ -9739,6 +9771,120 @@ var infoTagSlotRecipe = react.defineSlotRecipe({
9739
9771
  size: "md"
9740
9772
  }
9741
9773
  });
9774
+ var inputChipSlotRecipe = react.defineSlotRecipe({
9775
+ slots: tagAnatomy.keys(),
9776
+ className: "chakra-tag",
9777
+ base: {
9778
+ root: {
9779
+ display: "flex",
9780
+ direction: "row",
9781
+ width: "fit-content",
9782
+ height: "fit-content",
9783
+ alignItems: "center",
9784
+ justifyContent: "center",
9785
+ gap: "1",
9786
+ outline: "none",
9787
+ "&:focus": {
9788
+ outline: "2px solid",
9789
+ outlineColor: "outline.focus"
9790
+ }
9791
+ }
9792
+ },
9793
+ variants: {
9794
+ variant: {
9795
+ core: {
9796
+ root: {
9797
+ backgroundColor: "surface",
9798
+ border: "1px solid",
9799
+ borderColor: "outline",
9800
+ "&:hover": {
9801
+ outline: "2px solid",
9802
+ outlineColor: "core.outline.hover"
9803
+ },
9804
+ "&:active": {
9805
+ outline: "none",
9806
+ backgroundColor: "core.surface.active"
9807
+ }
9808
+ }
9809
+ },
9810
+ accent: {
9811
+ root: {
9812
+ backgroundColor: "accent.surface",
9813
+ color: "text.highlight",
9814
+ "& svg": {
9815
+ color: "icon.highlight"
9816
+ },
9817
+ "&:hover": {
9818
+ backgroundColor: "accent.surface.hover"
9819
+ },
9820
+ "&:active": {
9821
+ backgroundColor: "accent.surface.active",
9822
+ outline: "none"
9823
+ }
9824
+ }
9825
+ },
9826
+ brand: {
9827
+ root: {
9828
+ backgroundColor: "brand.surface",
9829
+ color: "text.inverted",
9830
+ "& svg": {
9831
+ color: "icon.inverted"
9832
+ },
9833
+ "&:hover": {
9834
+ backgroundColor: "brand.surface.hover"
9835
+ },
9836
+ "&:active": {
9837
+ backgroundColor: "brand.surface.active",
9838
+ outline: "none"
9839
+ }
9840
+ }
9841
+ }
9842
+ },
9843
+ size: {
9844
+ xs: {
9845
+ root: {
9846
+ fontSize: "desktop.xs",
9847
+ paddingX: "1.5",
9848
+ paddingY: "0",
9849
+ fontWeight: "normal",
9850
+ borderRadius: "xs"
9851
+ }
9852
+ },
9853
+ sm: {
9854
+ root: {
9855
+ fontSize: "desktop.sm",
9856
+ paddingX: "2",
9857
+ paddingY: "0.5",
9858
+ fontWeight: "bold",
9859
+ borderRadius: "9px"
9860
+ }
9861
+ },
9862
+ md: {
9863
+ root: {
9864
+ padding: 5,
9865
+ fontSize: "desktop.md",
9866
+ paddingX: "2",
9867
+ paddingY: "1",
9868
+ fontWeight: "bold",
9869
+ borderRadius: "sm"
9870
+ }
9871
+ },
9872
+ lg: {
9873
+ root: {
9874
+ fontSize: "desktop.md",
9875
+ paddingX: "2",
9876
+ paddingY: "3",
9877
+ fontWeight: "bold",
9878
+ borderRadius: "md"
9879
+ }
9880
+ }
9881
+ }
9882
+ },
9883
+ defaultVariants: {
9884
+ variant: "core",
9885
+ size: "sm"
9886
+ }
9887
+ });
9742
9888
  var lineIconSlotRecipe = react.defineSlotRecipe({
9743
9889
  slots: linjetagAnatomy.keys(),
9744
9890
  className: "spor-line-icon",
@@ -10766,7 +10912,7 @@ var selectSlotRecipe = react.defineSlotRecipe({
10766
10912
  outlineOffset: "2px",
10767
10913
  outline: "2px solid",
10768
10914
  outlineColor: "outline.focus",
10769
- backgroundColor: "ghost.surface.hover"
10915
+ backgroundColor: "accent.surface.hover"
10770
10916
  },
10771
10917
  "&[data-highlighted]": {
10772
10918
  outlineOffset: "2px",
@@ -10774,7 +10920,7 @@ var selectSlotRecipe = react.defineSlotRecipe({
10774
10920
  outlineColor: "outline.focus"
10775
10921
  },
10776
10922
  _active: {
10777
- backgroundColor: "ghost.surface.active"
10923
+ backgroundColor: "accent.surface.active"
10778
10924
  },
10779
10925
  _highlighted: {
10780
10926
  _active: {
@@ -10782,12 +10928,12 @@ var selectSlotRecipe = react.defineSlotRecipe({
10782
10928
  }
10783
10929
  },
10784
10930
  _hover: {
10785
- backgroundColor: "ghost.surface.hover",
10931
+ backgroundColor: "accent.surface.hover",
10786
10932
  outline: "2px solid core.outline",
10787
10933
  outlineOffset: "2px"
10788
10934
  },
10789
10935
  _selected: {
10790
- backgroundColor: "ghost.surface.active"
10936
+ backgroundColor: "accent.surface"
10791
10937
  },
10792
10938
  _icon: {
10793
10939
  width: 3,
@@ -11555,6 +11701,7 @@ var slotRecipes = {
11555
11701
  checkboxCard: choiceChipSlotRecipe,
11556
11702
  collapsible: collapsibleSlotRecipe,
11557
11703
  tooltip: popoverSlotRecipe,
11704
+ tag: inputChipSlotRecipe,
11558
11705
  menu: menuSlotRecipe
11559
11706
  };
11560
11707
  var animations = react.defineTokens.animations({
@@ -12734,6 +12881,7 @@ exports.Heading = Heading;
12734
12881
  exports.IconButton = IconButton;
12735
12882
  exports.InfoTag = InfoTag;
12736
12883
  exports.Input = Input;
12884
+ exports.InputChip = InputChip;
12737
12885
  exports.ItemDescription = ItemDescription;
12738
12886
  exports.ItemLabel = ItemLabel;
12739
12887
  exports.JumpButton = JumpButton;