@octaviaflow/core 3.0.3 → 3.0.5
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/components/Button/Button.d.ts +1 -1
- package/dist/components/Button/Button.d.ts.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/Radio/Radio.d.ts +3 -2
- package/dist/components/Radio/Radio.d.ts.map +1 -1
- package/dist/components/Radio/RadioGroup.d.ts +13 -1
- package/dist/components/Radio/RadioGroup.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts +16 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/SlideoutPanel/SlideoutPanel.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Textarea/Textarea.d.ts.map +1 -1
- package/dist/index.cjs +121 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +125 -16
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
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
|
|
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(
|
|
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
|
{
|
|
@@ -5972,7 +6010,7 @@ function DescriptionList({
|
|
|
5972
6010
|
// src/components/Dialog/Dialog.tsx
|
|
5973
6011
|
import { AnimatePresence as AnimatePresence3, motion as motion5 } from "framer-motion";
|
|
5974
6012
|
import { useRef as useRef11 } from "react";
|
|
5975
|
-
import { FocusScope, useDialog, useModal, useOverlay } from "react-aria";
|
|
6013
|
+
import { FocusScope, OverlayProvider, useDialog, useModal, useOverlay } from "react-aria";
|
|
5976
6014
|
import { createPortal } from "react-dom";
|
|
5977
6015
|
|
|
5978
6016
|
// src/utils/motion.ts
|
|
@@ -6092,7 +6130,10 @@ function DialogContent({
|
|
|
6092
6130
|
}
|
|
6093
6131
|
function Dialog(props) {
|
|
6094
6132
|
if (typeof document === "undefined") return null;
|
|
6095
|
-
return createPortal(
|
|
6133
|
+
return createPortal(
|
|
6134
|
+
/* @__PURE__ */ jsx26(OverlayProvider, { children: /* @__PURE__ */ jsx26(DialogContent, { ...props }) }),
|
|
6135
|
+
document.body
|
|
6136
|
+
);
|
|
6096
6137
|
}
|
|
6097
6138
|
|
|
6098
6139
|
// src/components/DonutChart/DonutChart.tsx
|
|
@@ -10085,15 +10126,26 @@ function RadioGroup({
|
|
|
10085
10126
|
orientation = "vertical",
|
|
10086
10127
|
disabled = false,
|
|
10087
10128
|
children,
|
|
10088
|
-
className
|
|
10129
|
+
className,
|
|
10130
|
+
name,
|
|
10131
|
+
required,
|
|
10132
|
+
id,
|
|
10133
|
+
"aria-label": ariaLabel,
|
|
10134
|
+
"aria-labelledby": ariaLabelledBy,
|
|
10135
|
+
"aria-describedby": ariaDescribedBy
|
|
10089
10136
|
}) {
|
|
10090
10137
|
const ariaProps = {
|
|
10091
|
-
label: typeof label === "string" ? label : "radio group",
|
|
10138
|
+
label: typeof label === "string" ? label : ariaLabel || "radio group",
|
|
10092
10139
|
value,
|
|
10093
10140
|
defaultValue,
|
|
10094
10141
|
onChange,
|
|
10095
10142
|
isDisabled: disabled,
|
|
10096
|
-
|
|
10143
|
+
isRequired: required,
|
|
10144
|
+
orientation,
|
|
10145
|
+
name,
|
|
10146
|
+
"aria-label": ariaLabel,
|
|
10147
|
+
"aria-labelledby": ariaLabelledBy,
|
|
10148
|
+
"aria-describedby": ariaDescribedBy
|
|
10097
10149
|
};
|
|
10098
10150
|
const state = $384704861d32dbed$export$bca9d026f8e704eb(ariaProps);
|
|
10099
10151
|
const ref = useRef23(null);
|
|
@@ -10103,6 +10155,7 @@ function RadioGroup({
|
|
|
10103
10155
|
{
|
|
10104
10156
|
...radioGroupProps,
|
|
10105
10157
|
ref,
|
|
10158
|
+
id,
|
|
10106
10159
|
className: cn(
|
|
10107
10160
|
"ods-radio-group",
|
|
10108
10161
|
`ods-radio-group--${orientation}`,
|
|
@@ -10119,7 +10172,13 @@ function RadioGroup({
|
|
|
10119
10172
|
|
|
10120
10173
|
// src/components/Radio/Radio.tsx
|
|
10121
10174
|
import { jsx as jsx61, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
10122
|
-
function Radio({
|
|
10175
|
+
function Radio({
|
|
10176
|
+
value,
|
|
10177
|
+
label,
|
|
10178
|
+
disabled = false,
|
|
10179
|
+
className,
|
|
10180
|
+
...props
|
|
10181
|
+
}) {
|
|
10123
10182
|
const state = useRadioGroupContext();
|
|
10124
10183
|
const ref = useRef24(null);
|
|
10125
10184
|
const { inputProps } = useRadio(
|
|
@@ -10132,6 +10191,14 @@ function Radio({ value, label, disabled = false, className }) {
|
|
|
10132
10191
|
ref
|
|
10133
10192
|
);
|
|
10134
10193
|
const isSelected = state.selectedValue === value;
|
|
10194
|
+
const {
|
|
10195
|
+
onClick: _onClick,
|
|
10196
|
+
onKeyDown: _onKeyDown,
|
|
10197
|
+
onKeyUp: _onKeyUp,
|
|
10198
|
+
onFocus: _onFocus,
|
|
10199
|
+
onBlur: _onBlur,
|
|
10200
|
+
...passthroughProps
|
|
10201
|
+
} = props;
|
|
10135
10202
|
return /* @__PURE__ */ jsxs60(
|
|
10136
10203
|
"label",
|
|
10137
10204
|
{
|
|
@@ -10142,7 +10209,15 @@ function Radio({ value, label, disabled = false, className }) {
|
|
|
10142
10209
|
className
|
|
10143
10210
|
),
|
|
10144
10211
|
children: [
|
|
10145
|
-
/* @__PURE__ */ jsx61(
|
|
10212
|
+
/* @__PURE__ */ jsx61(
|
|
10213
|
+
"input",
|
|
10214
|
+
{
|
|
10215
|
+
...passthroughProps,
|
|
10216
|
+
...inputProps,
|
|
10217
|
+
ref,
|
|
10218
|
+
className: "ods-radio__input"
|
|
10219
|
+
}
|
|
10220
|
+
),
|
|
10146
10221
|
/* @__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
10222
|
label && /* @__PURE__ */ jsx61("span", { className: "ods-radio__label", children: label })
|
|
10148
10223
|
]
|
|
@@ -10687,7 +10762,14 @@ function Select({
|
|
|
10687
10762
|
disabled = false,
|
|
10688
10763
|
size = "md",
|
|
10689
10764
|
className,
|
|
10690
|
-
name
|
|
10765
|
+
name,
|
|
10766
|
+
required,
|
|
10767
|
+
id,
|
|
10768
|
+
form,
|
|
10769
|
+
autoFocus,
|
|
10770
|
+
"aria-label": ariaLabel,
|
|
10771
|
+
"aria-labelledby": ariaLabelledBy,
|
|
10772
|
+
"aria-describedby": ariaDescribedBy
|
|
10691
10773
|
}) {
|
|
10692
10774
|
const triggerRef = useRef26(null);
|
|
10693
10775
|
const listBoxRef = useRef26(null);
|
|
@@ -10766,13 +10848,20 @@ function Select({
|
|
|
10766
10848
|
className
|
|
10767
10849
|
),
|
|
10768
10850
|
children: [
|
|
10769
|
-
label && /* @__PURE__ */ jsx66("label", { className: "ods-select__label", children: label }),
|
|
10851
|
+
label && /* @__PURE__ */ jsx66("label", { className: "ods-select__label", htmlFor: id, children: label }),
|
|
10770
10852
|
/* @__PURE__ */ jsx66(HiddenSelect, { state, triggerRef, label, name }),
|
|
10771
10853
|
/* @__PURE__ */ jsxs65(
|
|
10772
10854
|
"button",
|
|
10773
10855
|
{
|
|
10774
10856
|
...buttonProps,
|
|
10775
10857
|
ref: triggerRef,
|
|
10858
|
+
id,
|
|
10859
|
+
form,
|
|
10860
|
+
autoFocus,
|
|
10861
|
+
"aria-label": ariaLabel,
|
|
10862
|
+
"aria-labelledby": ariaLabelledBy,
|
|
10863
|
+
"aria-describedby": ariaDescribedBy,
|
|
10864
|
+
"aria-required": required || void 0,
|
|
10776
10865
|
className: cn("ods-select__trigger", state.isOpen && "ods-select__trigger--open"),
|
|
10777
10866
|
children: [
|
|
10778
10867
|
/* @__PURE__ */ jsx66("span", { className: "ods-select__value", children: selectedOption ? /* @__PURE__ */ jsxs65(Fragment13, { children: [
|
|
@@ -11390,7 +11479,7 @@ function Skeleton({ variant = "text", width, height, lines = 1, className }) {
|
|
|
11390
11479
|
// src/components/SlideoutPanel/SlideoutPanel.tsx
|
|
11391
11480
|
import { AnimatePresence as AnimatePresence9, motion as motion12 } from "framer-motion";
|
|
11392
11481
|
import { useRef as useRef28 } from "react";
|
|
11393
|
-
import { FocusScope as FocusScope2, useDialog as useDialog2, useModal as useModal2, useOverlay as useOverlay2 } from "react-aria";
|
|
11482
|
+
import { FocusScope as FocusScope2, OverlayProvider as OverlayProvider2, useDialog as useDialog2, useModal as useModal2, useOverlay as useOverlay2 } from "react-aria";
|
|
11394
11483
|
import { createPortal as createPortal8 } from "react-dom";
|
|
11395
11484
|
import { Fragment as Fragment16, jsx as jsx71, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
11396
11485
|
var slideVariants2 = {
|
|
@@ -11483,7 +11572,10 @@ function SlideoutContent({
|
|
|
11483
11572
|
}
|
|
11484
11573
|
function SlideoutPanel(props) {
|
|
11485
11574
|
if (typeof document === "undefined") return null;
|
|
11486
|
-
return createPortal8(
|
|
11575
|
+
return createPortal8(
|
|
11576
|
+
/* @__PURE__ */ jsx71(OverlayProvider2, { children: /* @__PURE__ */ jsx71(SlideoutContent, { ...props }) }),
|
|
11577
|
+
document.body
|
|
11578
|
+
);
|
|
11487
11579
|
}
|
|
11488
11580
|
|
|
11489
11581
|
// src/components/Slider/Slider.tsx
|
|
@@ -12085,6 +12177,14 @@ function Switch({
|
|
|
12085
12177
|
ref
|
|
12086
12178
|
);
|
|
12087
12179
|
const isOn = state.isSelected;
|
|
12180
|
+
const {
|
|
12181
|
+
onClick: _onClick,
|
|
12182
|
+
onKeyDown: _onKeyDown,
|
|
12183
|
+
onKeyUp: _onKeyUp,
|
|
12184
|
+
onFocus: _onFocus,
|
|
12185
|
+
onBlur: _onBlur,
|
|
12186
|
+
...passthroughProps
|
|
12187
|
+
} = props;
|
|
12088
12188
|
return /* @__PURE__ */ jsxs75(
|
|
12089
12189
|
"label",
|
|
12090
12190
|
{
|
|
@@ -12095,7 +12195,15 @@ function Switch({
|
|
|
12095
12195
|
className
|
|
12096
12196
|
),
|
|
12097
12197
|
children: [
|
|
12098
|
-
/* @__PURE__ */ jsx78(
|
|
12198
|
+
/* @__PURE__ */ jsx78(
|
|
12199
|
+
"input",
|
|
12200
|
+
{
|
|
12201
|
+
...passthroughProps,
|
|
12202
|
+
...inputProps,
|
|
12203
|
+
ref,
|
|
12204
|
+
className: "ods-switch__input"
|
|
12205
|
+
}
|
|
12206
|
+
),
|
|
12099
12207
|
/* @__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
12208
|
label && /* @__PURE__ */ jsx78("span", { className: "ods-switch__label", children: label })
|
|
12101
12209
|
]
|
|
@@ -12541,6 +12649,7 @@ function Textarea({
|
|
|
12541
12649
|
/* @__PURE__ */ jsx83(
|
|
12542
12650
|
"textarea",
|
|
12543
12651
|
{
|
|
12652
|
+
...props,
|
|
12544
12653
|
...inputProps,
|
|
12545
12654
|
ref,
|
|
12546
12655
|
rows,
|
|
@@ -15401,7 +15510,7 @@ function YamlViewer({
|
|
|
15401
15510
|
// src/provider/OdsProvider.tsx
|
|
15402
15511
|
import { generateCssVars, resolveConfig } from "@octaviaflow/config";
|
|
15403
15512
|
import { createContext as createContext3, useContext as useContext3, useEffect as useEffect21, useMemo as useMemo18 } from "react";
|
|
15404
|
-
import { OverlayProvider } from "react-aria";
|
|
15513
|
+
import { OverlayProvider as OverlayProvider3 } from "react-aria";
|
|
15405
15514
|
import { jsx as jsx98 } from "react/jsx-runtime";
|
|
15406
15515
|
var OdsContext = createContext3(null);
|
|
15407
15516
|
function OdsProvider({ config: userConfig, children }) {
|
|
@@ -15423,7 +15532,7 @@ function OdsProvider({ config: userConfig, children }) {
|
|
|
15423
15532
|
}
|
|
15424
15533
|
}, [resolved]);
|
|
15425
15534
|
const contextValue = useMemo18(() => ({ config: resolved }), [resolved]);
|
|
15426
|
-
return /* @__PURE__ */ jsx98(OdsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx98(
|
|
15535
|
+
return /* @__PURE__ */ jsx98(OdsContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx98(OverlayProvider3, { children }) });
|
|
15427
15536
|
}
|
|
15428
15537
|
function useOds() {
|
|
15429
15538
|
const ctx = useContext3(OdsContext);
|