@octaviaflow/core 3.0.3 → 3.0.4

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.
package/dist/index.js CHANGED
@@ -618,16 +618,38 @@ function Button({
618
618
  fullWidth = false,
619
619
  className,
620
620
  children,
621
+ type,
621
622
  ...props
622
623
  }) {
623
624
  const ref = useRef3(null);
624
625
  const isDisabled = disabled || loading;
625
- const { buttonProps } = useButton({ isDisabled, onPress: props.onClick }, ref);
626
+ const resolvedType = type ?? "button";
627
+ const { buttonProps } = useButton(
628
+ {
629
+ isDisabled,
630
+ onPress: props.onClick,
631
+ type: resolvedType
632
+ },
633
+ ref
634
+ );
626
635
  const { onDrag, onDragStart, onDragEnd, onAnimationStart, ...safeButtonProps } = buttonProps;
636
+ const {
637
+ onClick: _onClick,
638
+ onKeyDown: _onKeyDown,
639
+ onKeyUp: _onKeyUp,
640
+ onMouseDown: _onMouseDown,
641
+ onPointerDown: _onPointerDown,
642
+ onPointerUp: _onPointerUp,
643
+ onFocus: _onFocus,
644
+ onBlur: _onBlur,
645
+ ...passthroughProps
646
+ } = props;
627
647
  return /* @__PURE__ */ jsxs10(
628
648
  motion2.button,
629
649
  {
650
+ ...passthroughProps,
630
651
  ...safeButtonProps,
652
+ type: resolvedType,
631
653
  ref,
632
654
  className: cn(
633
655
  "ods-btn",
@@ -2444,6 +2466,14 @@ function Checkbox({
2444
2466
  ref
2445
2467
  );
2446
2468
  const isChecked = state.isSelected;
2469
+ const {
2470
+ onClick: _onClick,
2471
+ onKeyDown: _onKeyDown,
2472
+ onKeyUp: _onKeyUp,
2473
+ onFocus: _onFocus,
2474
+ onBlur: _onBlur,
2475
+ ...passthroughProps
2476
+ } = props;
2447
2477
  return /* @__PURE__ */ jsxs14(
2448
2478
  "label",
2449
2479
  {
@@ -2454,7 +2484,15 @@ function Checkbox({
2454
2484
  className
2455
2485
  ),
2456
2486
  children: [
2457
- /* @__PURE__ */ jsx15("input", { ...inputProps, ref, className: "ods-checkbox__input" }),
2487
+ /* @__PURE__ */ jsx15(
2488
+ "input",
2489
+ {
2490
+ ...passthroughProps,
2491
+ ...inputProps,
2492
+ ref,
2493
+ className: "ods-checkbox__input"
2494
+ }
2495
+ ),
2458
2496
  /* @__PURE__ */ jsx15(
2459
2497
  "div",
2460
2498
  {
@@ -10085,15 +10123,26 @@ function RadioGroup({
10085
10123
  orientation = "vertical",
10086
10124
  disabled = false,
10087
10125
  children,
10088
- className
10126
+ className,
10127
+ name,
10128
+ required,
10129
+ id,
10130
+ "aria-label": ariaLabel,
10131
+ "aria-labelledby": ariaLabelledBy,
10132
+ "aria-describedby": ariaDescribedBy
10089
10133
  }) {
10090
10134
  const ariaProps = {
10091
- label: typeof label === "string" ? label : "radio group",
10135
+ label: typeof label === "string" ? label : ariaLabel || "radio group",
10092
10136
  value,
10093
10137
  defaultValue,
10094
10138
  onChange,
10095
10139
  isDisabled: disabled,
10096
- orientation
10140
+ isRequired: required,
10141
+ orientation,
10142
+ name,
10143
+ "aria-label": ariaLabel,
10144
+ "aria-labelledby": ariaLabelledBy,
10145
+ "aria-describedby": ariaDescribedBy
10097
10146
  };
10098
10147
  const state = $384704861d32dbed$export$bca9d026f8e704eb(ariaProps);
10099
10148
  const ref = useRef23(null);
@@ -10103,6 +10152,7 @@ function RadioGroup({
10103
10152
  {
10104
10153
  ...radioGroupProps,
10105
10154
  ref,
10155
+ id,
10106
10156
  className: cn(
10107
10157
  "ods-radio-group",
10108
10158
  `ods-radio-group--${orientation}`,
@@ -10119,7 +10169,13 @@ function RadioGroup({
10119
10169
 
10120
10170
  // src/components/Radio/Radio.tsx
10121
10171
  import { jsx as jsx61, jsxs as jsxs60 } from "react/jsx-runtime";
10122
- function Radio({ value, label, disabled = false, className }) {
10172
+ function Radio({
10173
+ value,
10174
+ label,
10175
+ disabled = false,
10176
+ className,
10177
+ ...props
10178
+ }) {
10123
10179
  const state = useRadioGroupContext();
10124
10180
  const ref = useRef24(null);
10125
10181
  const { inputProps } = useRadio(
@@ -10132,6 +10188,14 @@ function Radio({ value, label, disabled = false, className }) {
10132
10188
  ref
10133
10189
  );
10134
10190
  const isSelected = state.selectedValue === value;
10191
+ const {
10192
+ onClick: _onClick,
10193
+ onKeyDown: _onKeyDown,
10194
+ onKeyUp: _onKeyUp,
10195
+ onFocus: _onFocus,
10196
+ onBlur: _onBlur,
10197
+ ...passthroughProps
10198
+ } = props;
10135
10199
  return /* @__PURE__ */ jsxs60(
10136
10200
  "label",
10137
10201
  {
@@ -10142,7 +10206,15 @@ function Radio({ value, label, disabled = false, className }) {
10142
10206
  className
10143
10207
  ),
10144
10208
  children: [
10145
- /* @__PURE__ */ jsx61("input", { ...inputProps, ref, className: "ods-radio__input" }),
10209
+ /* @__PURE__ */ jsx61(
10210
+ "input",
10211
+ {
10212
+ ...passthroughProps,
10213
+ ...inputProps,
10214
+ ref,
10215
+ className: "ods-radio__input"
10216
+ }
10217
+ ),
10146
10218
  /* @__PURE__ */ jsx61("div", { className: "ods-radio__circle", "aria-hidden": "true", children: /* @__PURE__ */ jsx61("div", { className: cn("ods-radio__dot", isSelected && "ods-radio__dot--visible") }) }),
10147
10219
  label && /* @__PURE__ */ jsx61("span", { className: "ods-radio__label", children: label })
10148
10220
  ]
@@ -10687,7 +10759,14 @@ function Select({
10687
10759
  disabled = false,
10688
10760
  size = "md",
10689
10761
  className,
10690
- name
10762
+ name,
10763
+ required,
10764
+ id,
10765
+ form,
10766
+ autoFocus,
10767
+ "aria-label": ariaLabel,
10768
+ "aria-labelledby": ariaLabelledBy,
10769
+ "aria-describedby": ariaDescribedBy
10691
10770
  }) {
10692
10771
  const triggerRef = useRef26(null);
10693
10772
  const listBoxRef = useRef26(null);
@@ -10766,13 +10845,20 @@ function Select({
10766
10845
  className
10767
10846
  ),
10768
10847
  children: [
10769
- label && /* @__PURE__ */ jsx66("label", { className: "ods-select__label", children: label }),
10848
+ label && /* @__PURE__ */ jsx66("label", { className: "ods-select__label", htmlFor: id, children: label }),
10770
10849
  /* @__PURE__ */ jsx66(HiddenSelect, { state, triggerRef, label, name }),
10771
10850
  /* @__PURE__ */ jsxs65(
10772
10851
  "button",
10773
10852
  {
10774
10853
  ...buttonProps,
10775
10854
  ref: triggerRef,
10855
+ id,
10856
+ form,
10857
+ autoFocus,
10858
+ "aria-label": ariaLabel,
10859
+ "aria-labelledby": ariaLabelledBy,
10860
+ "aria-describedby": ariaDescribedBy,
10861
+ "aria-required": required || void 0,
10776
10862
  className: cn("ods-select__trigger", state.isOpen && "ods-select__trigger--open"),
10777
10863
  children: [
10778
10864
  /* @__PURE__ */ jsx66("span", { className: "ods-select__value", children: selectedOption ? /* @__PURE__ */ jsxs65(Fragment13, { children: [
@@ -12085,6 +12171,14 @@ function Switch({
12085
12171
  ref
12086
12172
  );
12087
12173
  const isOn = state.isSelected;
12174
+ const {
12175
+ onClick: _onClick,
12176
+ onKeyDown: _onKeyDown,
12177
+ onKeyUp: _onKeyUp,
12178
+ onFocus: _onFocus,
12179
+ onBlur: _onBlur,
12180
+ ...passthroughProps
12181
+ } = props;
12088
12182
  return /* @__PURE__ */ jsxs75(
12089
12183
  "label",
12090
12184
  {
@@ -12095,7 +12189,15 @@ function Switch({
12095
12189
  className
12096
12190
  ),
12097
12191
  children: [
12098
- /* @__PURE__ */ jsx78("input", { ...inputProps, ref, className: "ods-switch__input" }),
12192
+ /* @__PURE__ */ jsx78(
12193
+ "input",
12194
+ {
12195
+ ...passthroughProps,
12196
+ ...inputProps,
12197
+ ref,
12198
+ className: "ods-switch__input"
12199
+ }
12200
+ ),
12099
12201
  /* @__PURE__ */ jsx78("div", { className: cn("ods-switch__track", isOn && "ods-switch__track--on"), "aria-hidden": "true", children: /* @__PURE__ */ jsx78("div", { className: "ods-switch__thumb" }) }),
12100
12202
  label && /* @__PURE__ */ jsx78("span", { className: "ods-switch__label", children: label })
12101
12203
  ]
@@ -12541,6 +12643,7 @@ function Textarea({
12541
12643
  /* @__PURE__ */ jsx83(
12542
12644
  "textarea",
12543
12645
  {
12646
+ ...props,
12544
12647
  ...inputProps,
12545
12648
  ref,
12546
12649
  rows,