fis-component 0.0.22 → 0.0.23

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.
Files changed (28) hide show
  1. package/dist/cjs/index.js +72 -4
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/cjs/types/src/components/Avatar/Avatar.stories.d.ts +1 -1
  4. package/dist/cjs/types/src/components/{GroupButton/GroupButton.stories.d.ts → ButtonGroup/ButtonGroup.stories.d.ts} +2 -2
  5. package/dist/{esm/types/src/components/GroupButton → cjs/types/src/components/ButtonGroup}/index.d.ts +2 -2
  6. package/dist/cjs/types/src/components/{GroupRadio → RadioGroup}/index.d.ts +2 -2
  7. package/dist/cjs/types/src/index.d.ts +3 -1
  8. package/dist/esm/index.js +70 -4
  9. package/dist/esm/index.js.map +1 -1
  10. package/dist/esm/types/src/components/Avatar/Avatar.stories.d.ts +1 -1
  11. package/dist/esm/types/src/components/{GroupButton/GroupButton.stories.d.ts → ButtonGroup/ButtonGroup.stories.d.ts} +2 -2
  12. package/dist/{cjs/types/src/components/GroupButton → esm/types/src/components/ButtonGroup}/index.d.ts +2 -2
  13. package/dist/esm/types/src/components/{GroupRadio → RadioGroup}/index.d.ts +2 -2
  14. package/dist/esm/types/src/index.d.ts +3 -1
  15. package/dist/index.d.ts +42 -2
  16. package/package.json +1 -1
  17. /package/dist/cjs/types/src/components/{GroupButton → ButtonGroup}/styles.d.ts +0 -0
  18. /package/dist/cjs/types/src/components/{GroupCheckbox/GroupCheckbox.stories.d.ts → CheckboxGroup/CheckboxGroup.stories.d.ts} +0 -0
  19. /package/dist/cjs/types/src/components/{GroupCheckbox → CheckboxGroup}/index.d.ts +0 -0
  20. /package/dist/cjs/types/src/components/{GroupCheckbox → CheckboxGroup}/styles.d.ts +0 -0
  21. /package/dist/cjs/types/src/components/{GroupRadio/GroupRadio.stories.d.ts → RadioGroup/RadioGroup.stories.d.ts} +0 -0
  22. /package/dist/cjs/types/src/components/{GroupRadio → RadioGroup}/styles.d.ts +0 -0
  23. /package/dist/esm/types/src/components/{GroupButton → ButtonGroup}/styles.d.ts +0 -0
  24. /package/dist/esm/types/src/components/{GroupCheckbox/GroupCheckbox.stories.d.ts → CheckboxGroup/CheckboxGroup.stories.d.ts} +0 -0
  25. /package/dist/esm/types/src/components/{GroupCheckbox → CheckboxGroup}/index.d.ts +0 -0
  26. /package/dist/esm/types/src/components/{GroupCheckbox → CheckboxGroup}/styles.d.ts +0 -0
  27. /package/dist/esm/types/src/components/{GroupRadio/GroupRadio.stories.d.ts → RadioGroup/RadioGroup.stories.d.ts} +0 -0
  28. /package/dist/esm/types/src/components/{GroupRadio → RadioGroup}/styles.d.ts +0 -0
package/dist/cjs/index.js CHANGED
@@ -4948,6 +4948,7 @@ const FISIconButton = React.forwardRef((props, ref) => {
4948
4948
  const { type, children, active = false, size = "md", variant = "primary", icon: iconProp, ...rest } = props;
4949
4949
  return (jsxRuntime.jsx(ButtonStyled, { ...rest, ref: ref, "$variant": variant, "$size": size, "$active": active, children: iconProp }));
4950
4950
  });
4951
+ FISIconButton.displayName = "FISIconButton";
4951
4952
 
4952
4953
  const GroupButtonContainerStyled = dt.div `
4953
4954
  overflow: hidden;
@@ -5218,7 +5219,7 @@ const IconStyled = dt.span `
5218
5219
  align-items: center;
5219
5220
  `;
5220
5221
 
5221
- const FISGroupButton = ({ className, size = "md", disabled = false, options, variant, }) => {
5222
+ const FISButtonGroup = ({ className, size = "md", disabled = false, options, variant, }) => {
5222
5223
  return (jsxRuntime.jsx(GroupButtonContainerStyled, { className: className, children: options.map((option, index) => (React.createElement(Button, { ...option, key: index, disabledContainer: disabled, size: size, variant: variant }))) }));
5223
5224
  };
5224
5225
  const Button = ({ disabledContainer, startIcon: startIconProp, endIcon: endIconProp, size = "md", variant = "default", label, disabled, ...rest }) => {
@@ -5229,7 +5230,7 @@ const Button = ({ disabledContainer, startIcon: startIconProp, endIcon: endIconP
5229
5230
  return (jsxRuntime.jsxs(ButtonItemStyled, { ...rest, disabled: disabledContainer || disabled, "$onlyIcon": onlyIcon, "$size": size, "$variant": variant, children: [startIcon, label && jsxRuntime.jsx("span", { className: "button-content", children: label }), endIcon] }));
5230
5231
  };
5231
5232
 
5232
- const DivContainerSC$3 = dt.div `
5233
+ const DivContainerSC$4 = dt.div `
5233
5234
  display: flex;
5234
5235
  align-items: center;
5235
5236
  `;
@@ -5309,8 +5310,9 @@ const BreadcrumbEllipsis = () => (jsxRuntime.jsxs(jsxRuntime.Fragment, { childre
5309
5310
  const FISBreadcrumb = ({ items, className }) => {
5310
5311
  if (items.length === 0)
5311
5312
  return null;
5312
- return (jsxRuntime.jsxs(DivContainerSC$3, { className: className, children: [items?.[0]?.icon && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(FISIconButton, { size: "xs", icon: items?.[0]?.icon, variant: "tertiary-invisible", onClick: items[0].onClick }), jsxRuntime.jsx(SeparatorIcon, {})] })), items.length > MAX_VISIBLE_ITEMS ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [items.slice(1, 2).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, index))), jsxRuntime.jsx(BreadcrumbEllipsis, {}), items.slice(-2).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, `end-${index}`)))] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.slice(1).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, index))) }))] }));
5313
+ return (jsxRuntime.jsxs(DivContainerSC$4, { className: className, children: [items?.[0]?.icon && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(FISIconButton, { size: "xs", icon: items?.[0]?.icon, variant: "tertiary-invisible", onClick: items[0].onClick }), jsxRuntime.jsx(SeparatorIcon, {})] })), items.length > MAX_VISIBLE_ITEMS ? (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [items.slice(1, 2).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, index))), jsxRuntime.jsx(BreadcrumbEllipsis, {}), items.slice(-2).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, `end-${index}`)))] })) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: items.slice(1).map((item, index) => (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(BreadcrumbItem, { ...item }), jsxRuntime.jsx(SeparatorIcon, {})] }, index))) }))] }));
5313
5314
  };
5315
+ FISBreadcrumb.displayName = "FISBreadcrumb";
5314
5316
 
5315
5317
  const SpanRadioControlSC = dt.span `
5316
5318
  display: inline-flex;
@@ -5498,6 +5500,39 @@ const FISRadio = React.forwardRef(({ className, children, subLabel, checked = fa
5498
5500
  });
5499
5501
  FISRadio.displayName = "FISRadio";
5500
5502
 
5503
+ const DivContainerSC$3 = dt.div `
5504
+ display: flex;
5505
+ flex-wrap: wrap;
5506
+ gap: 20px;
5507
+
5508
+ ${(props) => props.$direction === "row"
5509
+ ? lt `
5510
+ flex-direction: row;
5511
+ `
5512
+ : lt `
5513
+ flex-direction: column;
5514
+ `}
5515
+ `;
5516
+ const DivScreenReaderLabelSC$1 = dt.div `
5517
+ position: absolute;
5518
+ width: 1px;
5519
+ height: 1px;
5520
+ padding: 0;
5521
+ margin: -1px;
5522
+ overflow: hidden;
5523
+ clip: rect(0, 0, 0, 0);
5524
+ white-space: nowrap;
5525
+ border: 0;
5526
+ `;
5527
+
5528
+ function FISRadioGroup({ className, groupLabel, options, name, value, direction = "row", disabled, getOptionDisabled, onChange, onFocus, onBlur, }) {
5529
+ const groupId = "radio-group-" + React.useId();
5530
+ const handleChange = (option) => {
5531
+ onChange(option.value);
5532
+ };
5533
+ return (jsxRuntime.jsxs(DivContainerSC$3, { role: "radiogroup", className: className, "aria-labelledby": groupId, "$direction": direction, children: [jsxRuntime.jsx(DivScreenReaderLabelSC$1, { id: groupId, children: groupLabel }), options.map((option) => (jsxRuntime.jsx(FISRadio, { value: option.value, name: name, disabled: getOptionDisabled?.(option) ?? disabled, checked: option.value === value, onChange: () => handleChange(option), onFocus: onFocus, onBlur: onBlur, children: option.label }, option.value)))] }));
5534
+ }
5535
+
5501
5536
  const CheckboxControlStyled = dt.span `
5502
5537
  display: inline-flex;
5503
5538
  align-items: center;
@@ -5693,6 +5728,36 @@ const FISCheckbox = React.forwardRef(({ className, children, subLabel, checked =
5693
5728
  });
5694
5729
  FISCheckbox.displayName = "FISCheckbox";
5695
5730
 
5731
+ const DivGroupContainerSC = dt.div `
5732
+ display: flex;
5733
+ flex-wrap: wrap;
5734
+ gap: 20px;
5735
+ flex-direction: ${props => props.$direction};
5736
+ `;
5737
+ const DivScreenReaderLabelSC = dt.div `
5738
+ position: absolute;
5739
+ width: 1px;
5740
+ height: 1px;
5741
+ padding: 0;
5742
+ margin: -1px;
5743
+ overflow: hidden;
5744
+ clip: rect(0, 0, 0, 0);
5745
+ white-space: nowrap;
5746
+ border: 0;
5747
+ `;
5748
+
5749
+ function FISCheckboxGroup({ className, groupLabel, options, value = [], direction = "row", disabled, getOptionDisabled, onChange, onFocus, onBlur, }) {
5750
+ const groupId = "checkbox-group-" + React.useId();
5751
+ const validValue = value.filter((v) => options.some((option) => option.value === v));
5752
+ const handleChange = (option) => {
5753
+ const nextValue = validValue.includes(option.value)
5754
+ ? validValue.filter((v) => v !== option.value)
5755
+ : [...validValue, option.value];
5756
+ onChange(nextValue);
5757
+ };
5758
+ return (jsxRuntime.jsxs(DivGroupContainerSC, { role: "group", className: className, "$direction": direction, "aria-labelledby": groupId, children: [jsxRuntime.jsx(DivScreenReaderLabelSC, { id: groupId, children: groupLabel }), options.map((option) => (jsxRuntime.jsx(FISCheckbox, { value: option.value, disabled: getOptionDisabled?.(option) ?? disabled, checked: value.includes(option.value), onChange: () => handleChange(option), onFocus: onFocus, onBlur: onBlur, children: option.label }, option.value)))] }));
5759
+ }
5760
+
5696
5761
  var classnames = {exports: {}};
5697
5762
 
5698
5763
  /*!
@@ -6612,6 +6677,7 @@ const DivBadge = dt.div `
6612
6677
  const FISAvatar = ({ className, src, alt = "Avatar", badge = "rounded", size = "xl", icon, status = "green", color = "neutral", letter, isBadgeDot = true, }) => {
6613
6678
  return (jsxRuntime.jsxs(DivContainer, { className: className, "$size": size, "$badge": badge, "$color": color, children: [src ? (jsxRuntime.jsx(ImgAvatar, { "$size": size, "$badge": badge, src: src, alt: alt })) : icon ? (jsxRuntime.jsx(DivIcon, { "$size": size, "$badge": badge, children: icon })) : (jsxRuntime.jsx(SpanLetter, { "$size": size, "$badge": badge, "$color": color, children: letter?.slice(0, 2) })), isBadgeDot && jsxRuntime.jsx(DivBadge, { "$size": size, "$status": status })] }));
6614
6679
  };
6680
+ FISAvatar.displayName = "FISAvatar";
6615
6681
 
6616
6682
  const DicContainerSC = dt.div `
6617
6683
  display: flex;
@@ -7063,8 +7129,9 @@ FISInputStepper.displayName = "FISInputStepper";
7063
7129
  exports.FISAvatar = FISAvatar;
7064
7130
  exports.FISBreadcrumb = FISBreadcrumb;
7065
7131
  exports.FISButton = FISButton;
7132
+ exports.FISButtonGroup = FISButtonGroup;
7066
7133
  exports.FISCheckbox = FISCheckbox;
7067
- exports.FISGroupButton = FISGroupButton;
7134
+ exports.FISCheckboxGroup = FISCheckboxGroup;
7068
7135
  exports.FISIconButton = FISIconButton;
7069
7136
  exports.FISInputField = FISInputField;
7070
7137
  exports.FISInputLabel = FISInputLabel;
@@ -7072,6 +7139,7 @@ exports.FISInputStepper = FISInputStepper;
7072
7139
  exports.FISInputText = FISInputText;
7073
7140
  exports.FISLinkButton = FISLinkButton;
7074
7141
  exports.FISRadio = FISRadio;
7142
+ exports.FISRadioGroup = FISRadioGroup;
7075
7143
  exports.FISTextArea = FISTextArea;
7076
7144
  exports.FISThemeProvider = FISThemeProvider;
7077
7145
  //# sourceMappingURL=index.js.map