@luscii-healthtech/web-ui 44.1.0 → 44.2.0

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.
@@ -2435,7 +2435,7 @@ const LabelText = (props) => {
2435
2435
  const StyledCheckbox = React__namespace.default.forwardRef((props, ref) => {
2436
2436
  const { className } = props, attributes = __rest(props, ["className"]);
2437
2437
  return jsxRuntime.jsx("input", Object.assign({ ref, type: "checkbox" }, attributes, { className: classNames__default.default(
2438
- "ui:appearance-none ui:w-6 ui:h-6 ui:rounded",
2438
+ "ui:block ui:appearance-none ui:w-6 ui:h-6 ui:rounded",
2439
2439
  "ui:cursor-pointer ui:disabled:cursor-not-allowed",
2440
2440
  // Default styles
2441
2441
  "ui:border ui:border-border-neutral-primary-default ui:bg-white",
@@ -2457,13 +2457,36 @@ const StyledCheckbox = React__namespace.default.forwardRef((props, ref) => {
2457
2457
  ) }));
2458
2458
  });
2459
2459
 
2460
- const LabeledCheckbox = React__namespace.default.forwardRef((props, ref) => {
2461
- const { children, label, helperText, errorText, className, inputClassName } = props, attributes = __rest(props, ["children", "label", "helperText", "errorText", "className", "inputClassName"]);
2460
+ const LabeledCheckboxBase = React__namespace.default.forwardRef((props, ref) => {
2461
+ const { variant = "regular", children, label, helperText, errorText, className, inputClassName, aside } = props, attributes = __rest(props, ["variant", "children", "label", "helperText", "errorText", "className", "inputClassName", "aside"]);
2462
2462
  const { id, disabled } = attributes;
2463
2463
  const semanticId = React__namespace.default.useId();
2464
- return jsxRuntime.jsxs(Stack, { as: "label", axis: "x", gap: "xs", htmlFor: id, className: classNames__default.default("ui:cursor-pointer", {
2465
- "ui:cursor-not-allowed": disabled
2466
- }, className), children: [jsxRuntime.jsx("div", { className: "ui:flex ui:flex-row", children: jsxRuntime.jsx("div", { children: jsxRuntime.jsx(StyledCheckbox, Object.assign({ "aria-describedby": semanticId }, attributes, { ref, className: inputClassName })) }) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(LabelText, { className: classNames__default.default(
2464
+ const isCard = variant === "card";
2465
+ return jsxRuntime.jsxs(Stack, { as: "label", axis: "x", gap: "xs", htmlFor: id, className: classNames__default.default(
2466
+ "ui:cursor-pointer",
2467
+ {
2468
+ "ui:cursor-not-allowed": disabled
2469
+ },
2470
+ /**
2471
+ * Card styles
2472
+ */
2473
+ {
2474
+ "ui:p-m ui:radius-xxs ui:transition-shadow": isCard,
2475
+ // Default styles
2476
+ "ui:ring ui:ring:1 ui:ring-border-neutral-primary-default ui:bg-white": isCard,
2477
+ // Hovered styles
2478
+ "ui:hover:ring-border-neutral-primary-hovered": isCard,
2479
+ // Checked styles
2480
+ "ui:has-checked:not-has-disabled:bg-background-neutral-secondary-hovered ui:has-checked:ring-border-brand-primary-default ui:has-checked:not-has-disabled:ring-2 ui:ring-border-brand-primary-default": isCard,
2481
+ // Disabled styles
2482
+ "ui:has-disabled:ring-border-neutral-primary-disabled": isCard,
2483
+ // Disabled and checked styles
2484
+ "ui:has-disabled:checked:bg-background-brand-primary-disabled": isCard,
2485
+ // Checked and hovered styles
2486
+ "ui:has-checked:not-has-disabled:bg-background-neutral-secondary-hovered ui:has-checked:not-has-disabled:ring-2 ui:hover:has-checked:not-has-disabled:ring-border-brand-primary-hovered": isCard
2487
+ },
2488
+ className
2489
+ ), children: [jsxRuntime.jsx("div", { children: jsxRuntime.jsx(StyledCheckbox, Object.assign({ "aria-describedby": semanticId }, attributes, { ref, className: inputClassName })) }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(LabelText, { className: classNames__default.default(
2467
2490
  /**
2468
2491
  * Need a slight top margin to align with the checkbox indicator (height 24px). On
2469
2492
  * small screens the text is larger (line-height: 24px). That matches the indicator
@@ -2474,7 +2497,13 @@ const LabeledCheckbox = React__namespace.default.forwardRef((props, ref) => {
2474
2497
  {
2475
2498
  "ui:text-text-neutral-secondary-disabled": disabled
2476
2499
  }
2477
- ), children: children || label }), jsxRuntime.jsx(HelperAndErrorText, { helperText, errorText, describingId: semanticId })] })] });
2500
+ ), children: children || label }), jsxRuntime.jsx(HelperAndErrorText, { helperText, errorText, describingId: semanticId })] }), aside && jsxRuntime.jsx("div", { className: "ui:ml-auto ui:flex-shrink-0", children: aside })] });
2501
+ });
2502
+ const LabeledCheckbox = React__namespace.default.forwardRef((props, ref) => {
2503
+ return jsxRuntime.jsx(LabeledCheckboxBase, Object.assign({}, props, { ref, variant: "regular" }));
2504
+ });
2505
+ const LabeledCheckboxCard = React__namespace.default.forwardRef((props, ref) => {
2506
+ return jsxRuntime.jsx(LabeledCheckboxBase, Object.assign({}, props, { ref, variant: "card" }));
2478
2507
  });
2479
2508
 
2480
2509
  const LabeledCheckboxGroup = (props) => {
@@ -2483,6 +2512,17 @@ const LabeledCheckboxGroup = (props) => {
2483
2512
  return jsxRuntime.jsxs(Stack, { as: "fieldset", "aria-describedby": semanticId, className: classNames__default.default(className), gap: "xxs", children: [title && jsxRuntime.jsx("legend", { className: "ui:contents", children: jsxRuntime.jsx(Text, { children: title }) }), jsxRuntime.jsx(Stack, { gap: "m", children }), jsxRuntime.jsx(HelperAndErrorText, { helperText: props.helperText, errorText: props.errorText, describingId: semanticId })] });
2484
2513
  };
2485
2514
 
2515
+ const LabeledCheckboxCardGroup = (props) => {
2516
+ const { children, title, className, columns = 2, helperText, errorText } = props, attributes = __rest(props, ["children", "title", "className", "columns", "helperText", "errorText"]);
2517
+ const semanticId = React__namespace.default.useId();
2518
+ return jsxRuntime.jsxs(Stack, Object.assign({ as: "fieldset", "aria-describedby": semanticId, className, gap: "xxs" }, attributes, { children: [title && jsxRuntime.jsx("legend", { className: "ui:contents", children: jsxRuntime.jsx(Text, { children: title }) }), jsxRuntime.jsx("div", { className: classNames__default.default("ui:grid ui:gap-x-m ui:gap-y-xs ui:items-start", {
2519
+ "ui:grid-cols-1": columns === 1,
2520
+ "ui:grid-cols-2": columns === 2,
2521
+ "ui:grid-cols-3": columns === 3,
2522
+ "ui:grid-cols-4": columns === 4
2523
+ }), children }), jsxRuntime.jsx(HelperAndErrorText, { helperText, errorText, describingId: semanticId })] }));
2524
+ };
2525
+
2486
2526
  const Chip = ({ accessory, leadingIcon, onClick, text }) => {
2487
2527
  return jsxRuntime.jsx(SecondaryButton, { className: "ui:bg-transparent! ui:px-s! ui:radius-xxxxs!", onClick, leadingIcon, trailingIcon: accessory, children: text });
2488
2528
  };
@@ -6578,6 +6618,8 @@ exports.Input = Input;
6578
6618
  exports.InputSelect = InputSelectWithSubComponents;
6579
6619
  exports.LabelText = LabelText;
6580
6620
  exports.LabeledCheckbox = LabeledCheckbox;
6621
+ exports.LabeledCheckboxCard = LabeledCheckboxCard;
6622
+ exports.LabeledCheckboxCardGroup = LabeledCheckboxCardGroup;
6581
6623
  exports.LabeledCheckboxGroup = LabeledCheckboxGroup;
6582
6624
  exports.LabeledDatePicker = LabeledDatePicker;
6583
6625
  exports.LabeledInput = LabeledInput;