@viasat/beam-react 2.30.0 → 2.37.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.
- package/assets/ActionList.css +1 -1
- package/assets/Avatar.css +1 -1
- package/assets/Badge.css +1 -1
- package/assets/Button.css +1 -1
- package/assets/Checkbox.css +1 -1
- package/assets/Chip.css +1 -1
- package/assets/ChipGroup.css +1 -1
- package/assets/CloseButton.css +1 -1
- package/assets/DateField.css +1 -0
- package/assets/EmptyState.css +1 -1
- package/assets/FloatingUI.css +1 -0
- package/assets/InputChoiceGroup.css +1 -1
- package/assets/Link.css +1 -1
- package/assets/NativeSelect.css +1 -1
- package/assets/Pagination.css +1 -1
- package/assets/ProgressBar.css +1 -1
- package/assets/RadioButton.css +1 -1
- package/assets/Search.css +1 -1
- package/assets/SpinnerWrap.css +1 -1
- package/assets/Switch.css +1 -1
- package/assets/TextArea.css +1 -1
- package/assets/TextField.css +1 -1
- package/assets/card.css +1 -1
- package/assets/combobox.css +1 -1
- package/assets/dialog.css +1 -1
- package/assets/fileUpload.css +1 -1
- package/assets/header.css +1 -1
- package/assets/index.css +1 -1
- package/assets/panel.css +1 -1
- package/assets/segmentedControl.css +1 -1
- package/assets/slider.css +1 -1
- package/assets/stepper.css +1 -1
- package/chunks/DateField.Segment.7oCeBSNo.js +1 -0
- package/chunks/DateField.Segment.DbjGMAPP.js +99 -0
- package/chunks/FloatingUI.arrow.BK0jH2ge.js +1 -0
- package/chunks/FloatingUI.arrow.BXR2atOC.js +28 -0
- package/chunks/dialog.module.Djvqgz-x.js +1 -0
- package/chunks/{dialog.module.TRHzVysh.js → dialog.module.vokt9Lwb.js} +2 -1
- package/chunks/panel.module.BVmRxZHo.js +1 -0
- package/chunks/{panel.module.BblnuBjO.js → panel.module.CnHWv4EZ.js} +1 -3
- package/lib/ActionList/ActionList.Group.d.ts +1 -1
- package/lib/Autocomplete/Autocomplete.cjs.js +1 -1
- package/lib/Autocomplete/Autocomplete.d.ts +5 -5
- package/lib/Autocomplete/Autocomplete.es.js +296 -268
- package/lib/Autocomplete/AutocompleteDropdown.cjs.js +1 -1
- package/lib/Autocomplete/AutocompleteDropdown.es.js +15 -12
- package/lib/Breadcrumbs/BreadcrumbsItem.d.ts +1 -1
- package/lib/Dialog/Dialog.Body.cjs.js +1 -1
- package/lib/Dialog/Dialog.Body.es.js +1 -1
- package/lib/Dialog/Dialog.Content.cjs.js +1 -1
- package/lib/Dialog/Dialog.Content.es.js +1 -1
- package/lib/Dialog/Dialog.Footer.cjs.js +1 -1
- package/lib/Dialog/Dialog.Footer.es.js +1 -1
- package/lib/Dialog/Dialog.Header.cjs.js +1 -1
- package/lib/Dialog/Dialog.Header.es.js +1 -1
- package/lib/Dialog/Dialog.cjs.js +1 -1
- package/lib/Dialog/Dialog.es.js +1 -1
- package/lib/FloatingUI/FloatingUI.arrow.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.arrow.es.js +6 -17
- package/lib/FloatingUI/FloatingUI.content.cjs.js +1 -1
- package/lib/FloatingUI/FloatingUI.content.es.js +31 -32
- package/lib/Search/SearchDropdown.cjs.js +1 -1
- package/lib/Search/SearchDropdown.es.js +1 -1
- package/lib/Select/Select.cjs.js +1 -1
- package/lib/Select/Select.d.ts +3 -2
- package/lib/Select/Select.es.js +208 -195
- package/lib/Select/SelectDropdown.cjs.js +1 -1
- package/lib/Select/SelectDropdown.es.js +15 -12
- package/lib/SideNav/SideNavActionList.es.js +1 -0
- package/lib/SideNav/SideNavActionListItemLabel.d.ts +1 -1
- package/lib/Slider/DualSlider.cjs.js +1 -1
- package/lib/Slider/DualSlider.es.js +28 -27
- package/lib/Slider/SingleSlider.cjs.js +1 -1
- package/lib/Slider/SingleSlider.es.js +1 -1
- package/lib/Slider/Slider.es.js +17 -17
- package/lib/Slider/hooks/useDualSliderLogic.cjs.js +1 -1
- package/lib/Slider/hooks/useDualSliderLogic.es.js +14 -14
- package/lib/Slider/hooks/useSingleSliderLogic.cjs.js +1 -1
- package/lib/Slider/hooks/useSingleSliderLogic.es.js +17 -17
- package/lib/Tabs/Tabs.Group.d.ts +2 -2
- package/lib/Tabs/Tabs.Item.d.ts +2 -2
- package/lib/Tabs/Tabs.Panel.d.ts +2 -2
- package/lib/Text/Text.d.ts +2 -2
- package/lib/Text/Text.es.js +12 -12
- package/lib/_Options/Option.cjs.js +1 -1
- package/lib/_Options/Option.context.cjs.js +1 -1
- package/lib/_Options/Option.context.d.ts +31 -13
- package/lib/_Options/Option.context.es.js +133 -88
- package/lib/_Options/Option.es.js +23 -21
- package/lib/_Options/Option.types.d.ts +23 -0
- package/lib/_Options/OptionGroup.cjs.js +1 -0
- package/lib/_Options/OptionGroup.context.cjs.js +1 -0
- package/lib/_Options/OptionGroup.context.d.ts +6 -0
- package/lib/_Options/OptionGroup.context.es.js +6 -0
- package/lib/_Options/OptionGroup.d.ts +3 -0
- package/lib/_Options/OptionGroup.es.js +22 -0
- package/lib/_Options/getLastVisibleStructureIndex.cjs.js +1 -0
- package/lib/_Options/getLastVisibleStructureIndex.d.ts +15 -0
- package/lib/_Options/getLastVisibleStructureIndex.es.js +14 -0
- package/lib/_Options/index.cjs.js +1 -1
- package/lib/_Options/index.d.ts +4 -0
- package/lib/_Options/index.es.js +13 -4
- package/lib/_Options/useRenderOption.cjs.js +1 -0
- package/lib/_Options/useRenderOption.d.ts +30 -0
- package/lib/_Options/useRenderOption.es.js +43 -0
- package/lib/wip/DateField/DateField.Segment.cjs.js +1 -0
- package/lib/wip/DateField/DateField.Segment.d.ts +2 -0
- package/lib/wip/DateField/DateField.Segment.es.js +8 -0
- package/lib/wip/DateField/DateField.Segments.cjs.js +1 -0
- package/lib/wip/DateField/DateField.Segments.d.ts +17 -0
- package/lib/wip/DateField/DateField.Segments.es.js +61 -0
- package/lib/wip/DateField/DateField.cjs.js +1 -0
- package/lib/wip/DateField/DateField.d.ts +3 -0
- package/lib/wip/DateField/DateField.es.js +191 -0
- package/lib/wip/DateField/DateField.types.cjs.js +1 -0
- package/lib/wip/DateField/DateField.types.d.ts +118 -0
- package/lib/wip/DateField/DateField.types.es.js +1 -0
- package/lib/wip/DateField/DateField.utils.cjs.js +1 -0
- package/lib/wip/DateField/DateField.utils.d.ts +26 -0
- package/lib/wip/DateField/DateField.utils.es.js +45 -0
- package/lib/wip/DateField/DateField.validation.cjs.js +1 -0
- package/lib/wip/DateField/DateField.validation.d.ts +26 -0
- package/lib/wip/DateField/DateField.validation.es.js +24 -0
- package/lib/wip/DateField/index.cjs.js +1 -0
- package/lib/wip/DateField/index.d.ts +2 -0
- package/lib/wip/DateField/index.es.js +4 -0
- package/lib/wip/DateField/useDateFieldFocus.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldFocus.d.ts +23 -0
- package/lib/wip/DateField/useDateFieldFocus.es.js +65 -0
- package/lib/wip/DateField/useDateFieldForm.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldForm.d.ts +32 -0
- package/lib/wip/DateField/useDateFieldForm.es.js +51 -0
- package/lib/wip/DateField/useDateFieldSegments.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldSegments.d.ts +7 -0
- package/lib/wip/DateField/useDateFieldSegments.es.js +13 -0
- package/lib/wip/DateField/useDateFieldValidity.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldValidity.d.ts +23 -0
- package/lib/wip/DateField/useDateFieldValidity.es.js +19 -0
- package/lib/wip/DateField/useDateFieldValue.cjs.js +1 -0
- package/lib/wip/DateField/useDateFieldValue.d.ts +19 -0
- package/lib/wip/DateField/useDateFieldValue.es.js +62 -0
- package/lib/wip/DateField/useInvalidState.cjs.js +1 -0
- package/lib/wip/DateField/useInvalidState.d.ts +13 -0
- package/lib/wip/DateField/useInvalidState.es.js +8 -0
- package/lib/wip/Panel/Footer/Panel.Footer.Actions.cjs.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.Actions.es.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.cjs.js +1 -1
- package/lib/wip/Panel/Footer/Panel.Footer.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentAfter.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentAfter.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentBefore.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.ContentBefore.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Description.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Description.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Heading.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Heading.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Row.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Row.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Subheader.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.Subheader.es.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.cjs.js +1 -1
- package/lib/wip/Panel/Header/Panel.Header.es.js +1 -1
- package/lib/wip/Panel/Panel.Body.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Body.es.js +1 -1
- package/lib/wip/Panel/Panel.Inline.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Inline.d.ts +3 -1
- package/lib/wip/Panel/Panel.Inline.es.js +44 -40
- package/lib/wip/Panel/Panel.Overlay.cjs.js +1 -1
- package/lib/wip/Panel/Panel.Overlay.d.ts +18 -2
- package/lib/wip/Panel/Panel.Overlay.es.js +110 -84
- package/lib/wip/Panel/Panel.ResizeHandle.cjs.js +1 -1
- package/lib/wip/Panel/Panel.ResizeHandle.es.js +1 -1
- package/lib/wip/Panel/Panel.cjs.js +1 -1
- package/lib/wip/Panel/Panel.d.ts +1 -1
- package/lib/wip/Panel/Panel.es.js +125 -94
- package/lib/wip/Panel/Panel.helpers.cjs.js +1 -1
- package/lib/wip/Panel/Panel.helpers.d.ts +2 -1
- package/lib/wip/Panel/Panel.helpers.es.js +37 -35
- package/lib/wip/Panel/Panel.types.d.ts +64 -10
- package/lib/wip/Panel/Panel.useResize.cjs.js +1 -1
- package/lib/wip/Panel/Panel.useResize.d.ts +3 -1
- package/lib/wip/Panel/Panel.useResize.es.js +34 -30
- package/lib/wip/index.cjs.js +1 -1
- package/lib/wip/index.d.ts +1 -0
- package/lib/wip/index.es.js +4 -2
- package/package.json +6 -6
- package/utils/hooks/index.cjs.js +1 -1
- package/utils/hooks/index.d.ts +1 -0
- package/utils/hooks/index.es.js +12 -10
- package/utils/hooks/useElementResize.cjs.js +1 -1
- package/utils/hooks/useElementResize.d.ts +1 -1
- package/utils/hooks/useElementResize.es.js +33 -33
- package/utils/hooks/usePrevious.cjs.js +1 -0
- package/utils/hooks/usePrevious.d.ts +5 -0
- package/utils/hooks/usePrevious.es.js +10 -0
- package/assets/floatingui.css +0 -1
- package/chunks/dialog.module.C_6Qrg4w.js +0 -1
- package/chunks/floatingui.module.BcBFebz0.js +0 -10
- package/chunks/floatingui.module.D3Aw_aYe.js +0 -1
- package/chunks/panel.module.CVyUzyCZ.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react");function u(){const e=r.useRef(new Map),n=r.useCallback(t=>s=>{s?e.current.set(t,s):e.current.delete(t)},[]);return{segmentRefs:e,registerSegmentRef:n}}exports.useDateFieldSegments=u;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MutableRefObject } from 'react';
|
|
2
|
+
import { SegmentType } from './DateField.types';
|
|
3
|
+
export interface UseDateFieldSegmentsReturn {
|
|
4
|
+
segmentRefs: MutableRefObject<Map<SegmentType, HTMLSpanElement>>;
|
|
5
|
+
registerSegmentRef: (segment: SegmentType) => (element: HTMLSpanElement | null) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useDateFieldSegments(): UseDateFieldSegmentsReturn;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useRef as n, useCallback as u } from "react";
|
|
2
|
+
function f() {
|
|
3
|
+
const e = n(/* @__PURE__ */ new Map()), s = u(
|
|
4
|
+
(t) => (r) => {
|
|
5
|
+
r ? e.current.set(t, r) : e.current.delete(t);
|
|
6
|
+
},
|
|
7
|
+
[]
|
|
8
|
+
);
|
|
9
|
+
return { segmentRefs: e, registerSegmentRef: s };
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
f as useDateFieldSegments
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react"),s=["day","month","year"];function c({segments:l,currentValue:t,wasTouched:i,isFocused:n}){return u.useMemo(()=>{const a=s.reduce((r,d)=>l[d]!=null?r+1:r,0),e=a===3,o=a>0&&!e;return{allFilled:e,hasPartialValue:o,isInvalid:i&&(e&&t===null||o&&!n)}},[l,t,i,n])}exports.useDateFieldValidity=c;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Nullable } from '@viasat/beam-shared/utils/types';
|
|
2
|
+
import { SegmentValues } from './DateField.types';
|
|
3
|
+
export interface UseDateFieldValidityArgs {
|
|
4
|
+
segments: SegmentValues;
|
|
5
|
+
/** Result of `deriveValue(segments)` — passed in to avoid recomputing. */
|
|
6
|
+
currentValue: Nullable<Date>;
|
|
7
|
+
/** Gates error visibility — partial / invalid combos don't surface until the
|
|
8
|
+
* user has interacted with the field. */
|
|
9
|
+
wasTouched: boolean;
|
|
10
|
+
/** True when any segment in the field currently holds focus. The partial-
|
|
11
|
+
* on-blur rule only fires once focus has left. */
|
|
12
|
+
isFocused: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface UseDateFieldValidityReturn {
|
|
15
|
+
allFilled: boolean;
|
|
16
|
+
hasPartialValue: boolean;
|
|
17
|
+
/** "Show error?" for value-driven invalidity. True when the user has
|
|
18
|
+
* touched the field AND either:
|
|
19
|
+
* - all segments are filled but combine to an invalid date (Feb 30), or
|
|
20
|
+
* - some segments are filled, others empty, and focus has left the field. */
|
|
21
|
+
isInvalid: boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare function useDateFieldValidity({ segments, currentValue, wasTouched, isFocused, }: UseDateFieldValidityArgs): UseDateFieldValidityReturn;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useMemo as s } from "react";
|
|
2
|
+
const u = ["day", "month", "year"];
|
|
3
|
+
function m({
|
|
4
|
+
segments: n,
|
|
5
|
+
currentValue: t,
|
|
6
|
+
wasTouched: i,
|
|
7
|
+
isFocused: a
|
|
8
|
+
}) {
|
|
9
|
+
return s(() => {
|
|
10
|
+
const o = u.reduce(
|
|
11
|
+
(r, d) => n[d] != null ? r + 1 : r,
|
|
12
|
+
0
|
|
13
|
+
), l = o === 3, e = o > 0 && !l;
|
|
14
|
+
return { allFilled: l, hasPartialValue: e, isInvalid: i && (l && t === null || e && !a) };
|
|
15
|
+
}, [n, t, i, a]);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
m as useDateFieldValidity
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),r=require("./DateField.utils.cjs.js"),E=require("./DateField.validation.cjs.js");function j({value:u,defaultValue:F,onChange:m}){const T=t.useRef(u!==void 0),f=T.current,[c,g]=t.useState(()=>r.segmentTextFromValue(f?u??null:F??null)),[h,S]=t.useState(!1),s=t.useRef(c),a=t.useRef(new Set),x=t.useRef(!1),V={day:r.segmentNumber("day",c.day),month:r.segmentNumber("month",c.month),year:r.segmentNumber("year",c.year)},y=r.deriveValue(V),b=t.useRef(y),D=t.useRef(f?u??null:null),l=t.useRef(m);t.useEffect(()=>{l.current=m},[m]),t.useEffect(()=>{if(!T.current||x.current||r.isSameDateValue(u??null,D.current))return;D.current=u??null;const e=r.segmentTextFromValue(u??null);s.current=e,g(e),b.current=r.deriveValueFromText(e)},[u]);const o=t.useCallback(e=>{var i;const n=r.deriveValueFromText(e);r.isSameDateValue(n,b.current)||(b.current=n,(i=l.current)==null||i.call(l,n))},[]),_=t.useCallback((e,n)=>{const i=a.current.has(e)?"":s.current[e],d=E.tryAppendDigit(e,i,n);if(d.rejected)return{advanced:!1,rejected:!0};const R={...s.current,[e]:d.newBuffer};return s.current=R,g(R),S(!0),o(R),d.shouldAdvance?a.current.add(e):a.current.delete(e),{advanced:d.shouldAdvance,rejected:!1}},[o]),v=t.useCallback(e=>{x.current=!0,a.current.add(e)},[]),w=t.useCallback(()=>{x.current=!1;const e=s.current,n={day:r.normalizeSegmentText("day",e.day),month:r.normalizeSegmentText("month",e.month),year:r.normalizeSegmentText("year",e.year)};s.current=n,g(n),S(!0),o(n)},[o]);return{segmentText:c,segmentValues:V,currentValue:y,isControlled:f,wasTouched:h,appendDigit:_,beginSegmentEdit:v,commitOnBlur:w}}exports.useDateFieldValue=j;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Nullable } from '@viasat/beam-shared/utils/types';
|
|
2
|
+
import { AppendDigitResult, SegmentText, SegmentType, SegmentValues } from './DateField.types';
|
|
3
|
+
export interface UseDateFieldValueArgs {
|
|
4
|
+
value?: Nullable<Date>;
|
|
5
|
+
defaultValue?: Nullable<Date>;
|
|
6
|
+
/** Fires on user-driven value transitions only, never on controlled `value` changes. */
|
|
7
|
+
onChange?: (value: Nullable<Date>) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface UseDateFieldValueReturn {
|
|
10
|
+
segmentText: SegmentText;
|
|
11
|
+
segmentValues: SegmentValues;
|
|
12
|
+
currentValue: Nullable<Date>;
|
|
13
|
+
isControlled: boolean;
|
|
14
|
+
wasTouched: boolean;
|
|
15
|
+
appendDigit: (type: SegmentType, digit: string) => AppendDigitResult;
|
|
16
|
+
beginSegmentEdit: (type: SegmentType) => void;
|
|
17
|
+
commitOnBlur: () => void;
|
|
18
|
+
}
|
|
19
|
+
export declare function useDateFieldValue({ value, defaultValue, onChange, }: UseDateFieldValueArgs): UseDateFieldValueReturn;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { useRef as n, useState as E, useEffect as j, useCallback as i } from "react";
|
|
2
|
+
import { segmentTextFromValue as v, segmentNumber as T, deriveValue as C, isSameDateValue as w, deriveValueFromText as A, normalizeSegmentText as V } from "./DateField.utils.es.js";
|
|
3
|
+
import { tryAppendDigit as I } from "./DateField.validation.es.js";
|
|
4
|
+
function G({
|
|
5
|
+
value: r,
|
|
6
|
+
defaultValue: F,
|
|
7
|
+
onChange: m
|
|
8
|
+
}) {
|
|
9
|
+
const R = n(r !== void 0), f = R.current, [u, x] = E(
|
|
10
|
+
() => v(f ? r ?? null : F ?? null)
|
|
11
|
+
), [B, S] = E(!1), c = n(u), s = n(/* @__PURE__ */ new Set()), g = n(!1), p = {
|
|
12
|
+
day: T("day", u.day),
|
|
13
|
+
month: T("month", u.month),
|
|
14
|
+
year: T("year", u.year)
|
|
15
|
+
}, D = C(p), h = n(D), b = n(
|
|
16
|
+
f ? r ?? null : null
|
|
17
|
+
), o = n(m);
|
|
18
|
+
j(() => {
|
|
19
|
+
o.current = m;
|
|
20
|
+
}, [m]), j(() => {
|
|
21
|
+
if (!R.current || g.current || w(r ?? null, b.current)) return;
|
|
22
|
+
b.current = r ?? null;
|
|
23
|
+
const e = v(r ?? null);
|
|
24
|
+
c.current = e, x(e), h.current = A(e);
|
|
25
|
+
}, [r]);
|
|
26
|
+
const a = i((e) => {
|
|
27
|
+
var d;
|
|
28
|
+
const t = A(e);
|
|
29
|
+
w(t, h.current) || (h.current = t, (d = o.current) == null || d.call(o, t));
|
|
30
|
+
}, []), N = i(
|
|
31
|
+
(e, t) => {
|
|
32
|
+
const d = s.current.has(e) ? "" : c.current[e], l = I(e, d, t);
|
|
33
|
+
if (l.rejected) return { advanced: !1, rejected: !0 };
|
|
34
|
+
const y = { ...c.current, [e]: l.newBuffer };
|
|
35
|
+
return c.current = y, x(y), S(!0), a(y), l.shouldAdvance ? s.current.add(e) : s.current.delete(e), { advanced: l.shouldAdvance, rejected: !1 };
|
|
36
|
+
},
|
|
37
|
+
[a]
|
|
38
|
+
), k = i((e) => {
|
|
39
|
+
g.current = !0, s.current.add(e);
|
|
40
|
+
}, []), z = i(() => {
|
|
41
|
+
g.current = !1;
|
|
42
|
+
const e = c.current, t = {
|
|
43
|
+
day: V("day", e.day),
|
|
44
|
+
month: V("month", e.month),
|
|
45
|
+
year: V("year", e.year)
|
|
46
|
+
};
|
|
47
|
+
c.current = t, x(t), S(!0), a(t);
|
|
48
|
+
}, [a]);
|
|
49
|
+
return {
|
|
50
|
+
segmentText: u,
|
|
51
|
+
segmentValues: p,
|
|
52
|
+
currentValue: D,
|
|
53
|
+
isControlled: f,
|
|
54
|
+
wasTouched: B,
|
|
55
|
+
appendDigit: N,
|
|
56
|
+
beginSegmentEdit: k,
|
|
57
|
+
commitOnBlur: z
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
G as useDateFieldValue
|
|
62
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react"),o=({formInvalid:e,valueInvalid:t})=>s.useMemo(()=>e||t,[e,t]);exports.useInvalidState=o;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface UseInvalidStateArgs {
|
|
2
|
+
/** Invalid flag from `useDateFieldForm` (consumer error prop OR validator
|
|
3
|
+
* result). */
|
|
4
|
+
formInvalid: boolean;
|
|
5
|
+
/** Invalid flag from `useDateFieldValidity` (cross-segment Feb 30,
|
|
6
|
+
* partial-on-blur). */
|
|
7
|
+
valueInvalid: boolean;
|
|
8
|
+
}
|
|
9
|
+
/** Aggregates all error-state sources into a single flag for the
|
|
10
|
+
* `.date-field--error` modifier class. Scaffolding for DF-10 (minDate /
|
|
11
|
+
* maxDate) and any future validity rules — they slot in as new args here
|
|
12
|
+
* without touching the orchestrator's JSX. */
|
|
13
|
+
export declare const useInvalidState: ({ formInvalid, valueInvalid, }: UseInvalidStateArgs) => boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("clsx"),u=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const e=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("clsx"),u=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const e=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:m}=u.getBEMClassNames("panel"),t=({layout:n="end",children:o,className:a,...c})=>{const s=`${m}footer__actions`,r=i(e.styles[s],e.styles[`${s}--${n}`],a);return l.jsx("div",{className:r,...c,children:o})};t.displayName="Panel.Footer.Actions";exports.Actions=t;
|
|
@@ -2,7 +2,7 @@ import { jsx as n } from "react/jsx-runtime";
|
|
|
2
2
|
import i from "clsx";
|
|
3
3
|
import { g as c } from "../../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { s as o } from "../../../../chunks/panel.module.
|
|
5
|
+
import { s as o } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
6
6
|
const { subElementClassPrefix: l } = c("panel"), p = ({
|
|
7
7
|
layout: t = "end",
|
|
8
8
|
children: a,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("clsx"),_=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const u=require("../../../Divider/Divider.cjs.js"),m=require("../../../Box/Box.cjs.js"),b=require("../Panel.helpers.cjs.js"),d=require("./Panel.Footer.Actions.cjs.js"),q=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),c=require("clsx"),_=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const u=require("../../../Divider/Divider.cjs.js"),m=require("../../../Box/Box.cjs.js"),b=require("../Panel.helpers.cjs.js"),d=require("./Panel.Footer.Actions.cjs.js"),q=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:x}=_.getBEMClassNames("panel"),P=`${x}footer`,s=({children:r,className:o,divider:t=!0,dividerColor:i=b.DEFAULT_PANEL_DIVIDER_COLOR,backgroundColor:n,...l})=>{const a=c(q.styles[P],o);return e.jsxs(e.Fragment,{children:[t&&e.jsx(u.Divider,{borderColor:i}),e.jsx(m.Box,{as:"footer",className:a,backgroundColor:n,...l,children:r})]})};s.displayName="Panel.Footer";s.Actions=d.Actions;exports.Footer=s;
|
|
@@ -6,7 +6,7 @@ import { Divider as x } from "../../../Divider/Divider.es.js";
|
|
|
6
6
|
import { Box as C } from "../../../Box/Box.es.js";
|
|
7
7
|
import { DEFAULT_PANEL_DIVIDER_COLOR as E } from "../Panel.helpers.es.js";
|
|
8
8
|
import { Actions as N } from "./Panel.Footer.Actions.es.js";
|
|
9
|
-
import { s as d } from "../../../../chunks/panel.module.
|
|
9
|
+
import { s as d } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
10
10
|
const { subElementClassPrefix: A } = c("panel"), D = `${A}footer`, r = ({
|
|
11
11
|
children: s,
|
|
12
12
|
className: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("clsx"),o=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const c=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("clsx"),o=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const c=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:i}=o.getBEMClassNames("panel"),u=`${i}header`,e=({children:s,className:t,...n})=>{const r=l(c.styles[`${u}__content-after`],t);return a.jsx("div",{className:r,...n,children:s})};e.displayName="Panel.Header.ContentAfter";exports.ContentAfter=e;
|
|
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import o from "clsx";
|
|
3
3
|
import { g as m } from "../../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { s as n } from "../../../../chunks/panel.module.
|
|
5
|
+
import { s as n } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
6
6
|
const { subElementClassPrefix: l } = m("panel"), c = `${l}header`, f = ({
|
|
7
7
|
children: s,
|
|
8
8
|
className: e,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),a=require("clsx"),l=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const c=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react/jsx-runtime"),a=require("clsx"),l=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const c=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:i}=l.getBEMClassNames("panel"),u=`${i}header`,e=({children:s,className:t,...n})=>{const r=a(c.styles[`${u}__content-before`],t);return o.jsx("div",{className:r,...n,children:s})};e.displayName="Panel.Header.ContentBefore";exports.ContentBefore=e;
|
|
@@ -2,7 +2,7 @@ import { jsx as r } from "react/jsx-runtime";
|
|
|
2
2
|
import a from "clsx";
|
|
3
3
|
import { g as m } from "../../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { s as n } from "../../../../chunks/panel.module.
|
|
5
|
+
import { s as n } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
6
6
|
const { subElementClassPrefix: l } = m("panel"), c = `${l}header`, f = ({
|
|
7
7
|
children: e,
|
|
8
8
|
className: s,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("clsx"),c=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const l=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),n=require("clsx"),c=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const l=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:o}=c.getBEMClassNames("panel"),u=`${o}header`,e=({children:s,className:r,...t})=>{const a=n(l.styles[`${u}__description`],r);return i.jsx("div",{className:a,...t,children:s})};e.displayName="Panel.Header.Description";exports.Description=e;
|
|
@@ -2,7 +2,7 @@ import { jsx as o } from "react/jsx-runtime";
|
|
|
2
2
|
import t from "clsx";
|
|
3
3
|
import { g as i } from "../../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { s as m } from "../../../../chunks/panel.module.
|
|
5
|
+
import { s as m } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
6
6
|
const { subElementClassPrefix: l } = i("panel"), n = `${l}header`, p = ({
|
|
7
7
|
children: s,
|
|
8
8
|
className: e,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),o=require("react"),g=require("clsx"),m=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const q=require("../../../../chunks/FloatingUI.context.B15Tz_4h.js"),b=require("../Panel.context.cjs.js"),x=require("../../../../utils/hooks/useId.cjs.js"),I=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),o=require("react"),g=require("clsx"),m=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const q=require("../../../../chunks/FloatingUI.context.B15Tz_4h.js"),b=require("../Panel.context.cjs.js"),x=require("../../../../utils/hooks/useId.cjs.js"),I=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:y}=m.getBEMClassNames("panel"),P=`${y}header`,a=({children:r,className:i,id:c,...l})=>{const u=x.useId(),e=c??u,d=g(I.styles[`${P}__heading`],i),t=o.useContext(b.PanelContext),n=o.useContext(q.BmFloatingUIContext),s=(t==null?void 0:t.kind)==="overlay"?n==null?void 0:n.setLabelId:void 0;return o.useLayoutEffect(()=>{if(!(!s||!e))return s(e),()=>s(void 0)},[e,s]),_.jsx("div",{id:e,className:d,...l,children:r})};a.displayName="Panel.Header.Heading";exports.Heading=a;
|
|
@@ -6,7 +6,7 @@ import "../../../../chunks/constants.CKKGf1-i.js";
|
|
|
6
6
|
import { B as g } from "../../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
7
7
|
import { PanelContext as x } from "../Panel.context.es.js";
|
|
8
8
|
import { useId as I } from "../../../../utils/hooks/useId.es.js";
|
|
9
|
-
import { s as b } from "../../../../chunks/panel.module.
|
|
9
|
+
import { s as b } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
10
10
|
const { subElementClassPrefix: v } = u("panel"), y = `${v}header`, C = ({
|
|
11
11
|
children: a,
|
|
12
12
|
className: m,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("clsx"),b=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const m=require("../../../CloseButton/CloseButton.cjs.js"),_=require("../../../Tooltip/Tooltip.cjs.js"),p=require("../Panel.context.cjs.js"),t=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),d=require("clsx"),b=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const m=require("../../../CloseButton/CloseButton.cjs.js"),_=require("../../../Tooltip/Tooltip.cjs.js"),p=require("../Panel.context.cjs.js"),t=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:x}=b.getBEMClassNames("panel"),l=`${x}header`,o=({children:n,className:r,...a})=>{const{dismissible:i,closeButtonAriaLabel:s,requestClose:c}=p.usePanelContext(),u=d(t.styles[`${l}__row`],r);return e.jsxs("div",{className:u,...a,children:[n,i&&e.jsx("div",{className:t.styles[`${l}__close-button`],children:e.jsx(_.Tooltip,{text:s,placement:"bottom",portalled:!0,role:{enabled:!1},children:e.jsx(m.CloseButton,{"aria-label":s,onClick:()=>c("closeButton"),size:"lg"})})})]})};o.displayName="Panel.Header.Row";exports.Row=o;
|
|
@@ -5,7 +5,7 @@ import "../../../../chunks/constants.CKKGf1-i.js";
|
|
|
5
5
|
import { CloseButton as f } from "../../../CloseButton/CloseButton.es.js";
|
|
6
6
|
import { Tooltip as u } from "../../../Tooltip/Tooltip.es.js";
|
|
7
7
|
import { usePanelContext as b } from "../Panel.context.es.js";
|
|
8
|
-
import { s as o } from "../../../../chunks/panel.module.
|
|
8
|
+
import { s as o } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
9
9
|
const { subElementClassPrefix: x } = d("panel"), t = `${x}header`, C = ({
|
|
10
10
|
children: l,
|
|
11
11
|
className: r,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("clsx"),u=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const c=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("clsx"),u=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const c=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:o}=u.getBEMClassNames("panel"),i=`${o}header`,e=({children:s,className:a,...r})=>{const t=n(c.styles[`${i}__subheader`],a);return l.jsx("div",{className:t,...r,children:s})};e.displayName="Panel.Header.Subheader";exports.Subheader=e;
|
|
@@ -2,7 +2,7 @@ import { jsx as m } from "react/jsx-runtime";
|
|
|
2
2
|
import o from "clsx";
|
|
3
3
|
import { g as t } from "../../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../../chunks/constants.CKKGf1-i.js";
|
|
5
|
-
import { s as l } from "../../../../chunks/panel.module.
|
|
5
|
+
import { s as l } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
6
6
|
const { subElementClassPrefix: i } = t("panel"), n = `${i}header`, p = ({
|
|
7
7
|
children: s,
|
|
8
8
|
className: e,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("clsx"),d=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const c=require("../../../Divider/Divider.cjs.js"),u=require("../../../Box/Box.cjs.js"),H=require("../Panel.helpers.cjs.js"),P=require("./Panel.Header.Row.cjs.js"),b=require("./Panel.Header.ContentBefore.cjs.js"),p=require("./Panel.Header.Heading.cjs.js"),q=require("./Panel.Header.ContentAfter.cjs.js"),C=require("./Panel.Header.Description.cjs.js"),m=require("./Panel.Header.Subheader.cjs.js"),w=require("../../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),o=require("clsx"),d=require("../../../../chunks/classNames.DAeKwerT.js");require("../../../../chunks/constants.hwjHOsvT.js");const c=require("../../../Divider/Divider.cjs.js"),u=require("../../../Box/Box.cjs.js"),H=require("../Panel.helpers.cjs.js"),P=require("./Panel.Header.Row.cjs.js"),b=require("./Panel.Header.ContentBefore.cjs.js"),p=require("./Panel.Header.Heading.cjs.js"),q=require("./Panel.Header.ContentAfter.cjs.js"),C=require("./Panel.Header.Description.cjs.js"),m=require("./Panel.Header.Subheader.cjs.js"),w=require("../../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:x}=d.getBEMClassNames("panel"),D=`${x}header`,e=({children:n,className:a,divider:i=!0,dividerColor:s=H.DEFAULT_PANEL_DIVIDER_COLOR,backgroundColor:t,..._})=>{const l=o(w.styles[D],a);return r.jsxs(r.Fragment,{children:[r.jsx(u.Box,{as:"header",className:l,backgroundColor:t,..._,children:n}),i&&r.jsx(c.Divider,{borderColor:s})]})};e.displayName="Panel.Header";e.Row=P.Row;e.ContentBefore=b.ContentBefore;e.Heading=p.Heading;e.Description=C.Description;e.ContentAfter=q.ContentAfter;e.Subheader=m.Subheader;exports.Header=e;
|
|
@@ -11,7 +11,7 @@ import { Heading as g } from "./Panel.Header.Heading.es.js";
|
|
|
11
11
|
import { ContentAfter as h } from "./Panel.Header.ContentAfter.es.js";
|
|
12
12
|
import { Description as u } from "./Panel.Header.Description.es.js";
|
|
13
13
|
import { Subheader as E } from "./Panel.Header.Subheader.es.js";
|
|
14
|
-
import { s as N } from "../../../../chunks/panel.module.
|
|
14
|
+
import { s as N } from "../../../../chunks/panel.module.CnHWv4EZ.js";
|
|
15
15
|
const { subElementClassPrefix: A } = d("panel"), B = `${A}header`, r = ({
|
|
16
16
|
children: e,
|
|
17
17
|
className: t,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("clsx"),c=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const i=require("../../Box/Box.cjs.js"),u=require("../../../chunks/panel.module.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),n=require("clsx"),c=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const i=require("../../Box/Box.cjs.js"),u=require("../../../chunks/panel.module.BVmRxZHo.js"),{subElementClassPrefix:m}=c.getBEMClassNames("panel"),d=`${m}body`,e=({children:s,className:o,backgroundColor:t,...r})=>{const a=n(u.styles[d],o);return l.jsx(i.Box,{className:a,backgroundColor:t,...r,children:s})};e.displayName="Panel.Body";exports.Body=e;
|
|
@@ -3,7 +3,7 @@ import e from "clsx";
|
|
|
3
3
|
import { g as l } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
5
|
import { Box as p } from "../../Box/Box.es.js";
|
|
6
|
-
import { s as i } from "../../../chunks/panel.module.
|
|
6
|
+
import { s as i } from "../../../chunks/panel.module.CnHWv4EZ.js";
|
|
7
7
|
const { subElementClassPrefix: n } = l("panel"), c = `${n}body`, f = ({
|
|
8
8
|
children: s,
|
|
9
9
|
className: o,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),b=require("@floating-ui/react"),F=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const R=require("./Panel.context.cjs.js"),h=require("../../FloatingUI/FloatingUI.root.cjs.js"),w=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),j=require("./Panel.Divider.cjs.js"),U=require("./Panel.ResizeHandle.cjs.js"),N=require("./Panel.useResize.cjs.js"),y=require("../../../chunks/panel.module.BVmRxZHo.js"),{baseClassNamePrefix:v}=F.getBEMClassNames("panel"),C=({children:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,alwaysVisible:i,skipMountAnimation:_,dividerColor:t,resizeConfig:s,sizeStyle:x,...d})=>{const{context:p,transitionConfig:g,refs:I}=w.useBmFloatingUIContext(),{isMounted:f,status:P}=b.useTransitionStatus(p,g),m=(i||_)&&P==="initial"?"open":P,{handleRef:q}=N.usePanelResize({resizeConfig:s,position:n,floatingRef:I.floating});return f?e.jsxs(e.Fragment,{children:[o&&e.jsx(j.InlineDivider,{position:n,dividerColor:t}),e.jsx("div",{ref:I.setFloating,className:r,"data-position":n,"data-status":m,style:x,children:e.jsxs("div",{className:y.styles[`${v}__inline-wrapper-content`],children:[c&&e.jsx(j.InlineDivider,{position:n,dividerColor:t}),e.jsxs("aside",{...d,className:l,children:[a,s&&e.jsx(U.PanelResizeHandle,{ref:q})]})]})}),u&&e.jsx(j.InlineDivider,{position:n,dividerColor:t})]}):null},D=({contextValue:a,panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,open:i,transitionConfig:_,dividerColor:t,children:s,resizeConfig:x,sizeStyle:d,skipMountAnimation:p,...g})=>e.jsx(R.PanelContext.Provider,{value:a,children:e.jsx(h.FloatingUIRoot,{open:i??!0,portalled:!1,transitionConfig:_,children:e.jsx(C,{panelClassName:l,inlineWrapperClassName:r,resolvedPosition:n,dividerBefore:o,dividerInner:c,dividerAfter:u,dividerColor:t,alwaysVisible:i===void 0,skipMountAnimation:p,resizeConfig:x,sizeStyle:d,...g,children:s})})});exports.InlinePanel=D;
|
|
@@ -14,8 +14,10 @@ type InlinePanelProps = {
|
|
|
14
14
|
children: React.ReactNode;
|
|
15
15
|
dividerColor?: PanelDividerColor;
|
|
16
16
|
resizeConfig?: PanelResizeConfig;
|
|
17
|
+
/** Forwarded from Panel: CSS custom-property override for the panel size. */
|
|
18
|
+
sizeStyle?: React.CSSProperties;
|
|
17
19
|
/** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
|
|
18
20
|
skipMountAnimation?: boolean;
|
|
19
21
|
} & React.ComponentPropsWithoutRef<'aside'>;
|
|
20
|
-
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig, skipMountAnimation, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export declare const InlinePanel: ({ contextValue, panelClassName, inlineWrapperClassName, resolvedPosition, dividerBefore, dividerInner, dividerAfter, open, transitionConfig, dividerColor, children, resizeConfig, sizeStyle, skipMountAnimation, ...props }: InlinePanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
23
|
export {};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { useTransitionStatus as
|
|
1
|
+
import { jsx as t, jsxs as x, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import { useTransitionStatus as y } from "@floating-ui/react";
|
|
3
3
|
import { g as P } from "../../../chunks/classNames.BTJmrO_L.js";
|
|
4
4
|
import "../../../chunks/constants.CKKGf1-i.js";
|
|
5
5
|
import { PanelContext as U } from "./Panel.context.es.js";
|
|
6
6
|
import { FloatingUIRoot as b } from "../../FloatingUI/FloatingUI.root.es.js";
|
|
7
7
|
import { a as j } from "../../../chunks/FloatingUI.context.Dl4Y1y1z.js";
|
|
8
|
-
import { InlineDivider as
|
|
9
|
-
import { PanelResizeHandle as
|
|
10
|
-
import { usePanelResize as
|
|
11
|
-
import { s as
|
|
12
|
-
const { baseClassNamePrefix:
|
|
13
|
-
children:
|
|
8
|
+
import { InlineDivider as h } from "./Panel.Divider.es.js";
|
|
9
|
+
import { PanelResizeHandle as B } from "./Panel.ResizeHandle.es.js";
|
|
10
|
+
import { usePanelResize as M } from "./Panel.useResize.es.js";
|
|
11
|
+
import { s as S } from "../../../chunks/panel.module.CnHWv4EZ.js";
|
|
12
|
+
const { baseClassNamePrefix: _ } = P("panel"), z = ({
|
|
13
|
+
children: i,
|
|
14
14
|
panelClassName: o,
|
|
15
15
|
inlineWrapperClassName: r,
|
|
16
16
|
resolvedPosition: n,
|
|
@@ -20,43 +20,45 @@ const { baseClassNamePrefix: S } = P("panel"), _ = ({
|
|
|
20
20
|
alwaysVisible: e,
|
|
21
21
|
skipMountAnimation: f,
|
|
22
22
|
dividerColor: a,
|
|
23
|
-
resizeConfig:
|
|
24
|
-
|
|
23
|
+
resizeConfig: s,
|
|
24
|
+
sizeStyle: c,
|
|
25
|
+
...u
|
|
25
26
|
}) => {
|
|
26
27
|
const {
|
|
27
|
-
context:
|
|
28
|
-
transitionConfig:
|
|
29
|
-
refs:
|
|
30
|
-
} = j(), { isMounted:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
),
|
|
34
|
-
resizeConfig:
|
|
28
|
+
context: d,
|
|
29
|
+
transitionConfig: g,
|
|
30
|
+
refs: I
|
|
31
|
+
} = j(), { isMounted: R, status: N } = y(
|
|
32
|
+
d,
|
|
33
|
+
g
|
|
34
|
+
), C = (e || f) && N === "initial" ? "open" : N, { handleRef: F } = M({
|
|
35
|
+
resizeConfig: s,
|
|
35
36
|
position: n,
|
|
36
|
-
floatingRef:
|
|
37
|
+
floatingRef: I.floating
|
|
37
38
|
});
|
|
38
|
-
return
|
|
39
|
-
l && /* @__PURE__ */ t(
|
|
39
|
+
return R ? /* @__PURE__ */ x(w, { children: [
|
|
40
|
+
l && /* @__PURE__ */ t(h, { position: n, dividerColor: a }),
|
|
40
41
|
/* @__PURE__ */ t(
|
|
41
42
|
"div",
|
|
42
43
|
{
|
|
43
|
-
ref:
|
|
44
|
+
ref: I.setFloating,
|
|
44
45
|
className: r,
|
|
45
46
|
"data-position": n,
|
|
46
|
-
"data-status":
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
|
|
51
|
-
i
|
|
47
|
+
"data-status": C,
|
|
48
|
+
style: c,
|
|
49
|
+
children: /* @__PURE__ */ x("div", { className: S[`${_}__inline-wrapper-content`], children: [
|
|
50
|
+
m && /* @__PURE__ */ t(h, { position: n, dividerColor: a }),
|
|
51
|
+
/* @__PURE__ */ x("aside", { ...u, className: o, children: [
|
|
52
|
+
i,
|
|
53
|
+
s && /* @__PURE__ */ t(B, { ref: F })
|
|
52
54
|
] })
|
|
53
55
|
] })
|
|
54
56
|
}
|
|
55
57
|
),
|
|
56
|
-
p && /* @__PURE__ */ t(
|
|
58
|
+
p && /* @__PURE__ */ t(h, { position: n, dividerColor: a })
|
|
57
59
|
] }) : null;
|
|
58
|
-
},
|
|
59
|
-
contextValue:
|
|
60
|
+
}, J = ({
|
|
61
|
+
contextValue: i,
|
|
60
62
|
panelClassName: o,
|
|
61
63
|
inlineWrapperClassName: r,
|
|
62
64
|
resolvedPosition: n,
|
|
@@ -66,18 +68,19 @@ const { baseClassNamePrefix: S } = P("panel"), _ = ({
|
|
|
66
68
|
open: e,
|
|
67
69
|
transitionConfig: f,
|
|
68
70
|
dividerColor: a,
|
|
69
|
-
children:
|
|
71
|
+
children: s,
|
|
70
72
|
resizeConfig: c,
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
sizeStyle: u,
|
|
74
|
+
skipMountAnimation: d,
|
|
75
|
+
...g
|
|
76
|
+
}) => /* @__PURE__ */ t(U.Provider, { value: i, children: /* @__PURE__ */ t(
|
|
74
77
|
b,
|
|
75
78
|
{
|
|
76
79
|
open: e ?? !0,
|
|
77
80
|
portalled: !1,
|
|
78
81
|
transitionConfig: f,
|
|
79
82
|
children: /* @__PURE__ */ t(
|
|
80
|
-
|
|
83
|
+
z,
|
|
81
84
|
{
|
|
82
85
|
panelClassName: o,
|
|
83
86
|
inlineWrapperClassName: r,
|
|
@@ -87,14 +90,15 @@ const { baseClassNamePrefix: S } = P("panel"), _ = ({
|
|
|
87
90
|
dividerAfter: p,
|
|
88
91
|
dividerColor: a,
|
|
89
92
|
alwaysVisible: e === void 0,
|
|
90
|
-
skipMountAnimation:
|
|
93
|
+
skipMountAnimation: d,
|
|
91
94
|
resizeConfig: c,
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
sizeStyle: u,
|
|
96
|
+
...g,
|
|
97
|
+
children: s
|
|
94
98
|
}
|
|
95
99
|
)
|
|
96
100
|
}
|
|
97
101
|
) });
|
|
98
102
|
export {
|
|
99
|
-
|
|
103
|
+
J as InlinePanel
|
|
100
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),M=require("clsx"),g=require("react"),h=require("../../../chunks/classNames.DAeKwerT.js");require("../../../chunks/constants.hwjHOsvT.js");const w=require("./Panel.context.cjs.js"),S=require("./Panel.helpers.cjs.js"),k=require("../../FloatingUI/FloatingUI.root.cjs.js"),D=require("../../FloatingUI/FloatingUI.content.cjs.js"),B=require("../../../chunks/FloatingUI.context.B15Tz_4h.js"),$=require("./Panel.Divider.cjs.js"),z=require("./Panel.ResizeHandle.cjs.js"),A=require("./Panel.useResize.cjs.js"),p=require("../../../chunks/panel.module.BVmRxZHo.js"),{baseClassNamePrefix:C,variable:f}=h.getBEMClassNames("panel");function H(s,t,e){if(!(!s&&!t&&!e))return{...s,...t,...e?{[f("offset-x")]:e.x,[f("offset-y")]:e.y}:null}}const R=({children:s,panelClassName:t,resolvedPosition:e,showDivider:c,dividerColor:l,resizeConfig:a,floatingOffset:_,overlayDividerClassName:d,isBlocking:P,sizeStyle:v,skipMountAnimation:x,container:u,style:q,...b})=>{const{refs:y}=B.useBmFloatingUIContext(),{handleRef:r}=A.usePanelResize({resizeConfig:a,position:e,floatingRef:y.floating,requireMount:!0,container:u}),n=H(q,v,_);return i.jsxs(D.Content,{className:t,skipFloatingStyles:!0,overlay:P?u?{lockScroll:!1}:!0:!1,...b,style:n,"data-position":e,...x?{"data-status":"open"}:{},children:[s,c&&i.jsx($.InlineDivider,{position:e,className:d,dividerColor:l}),a&&i.jsx(z.PanelResizeHandle,{ref:r})]})},E=({contextValue:s,panelClassName:t,resolvedPosition:e,showDivider:c,modalType:l,closeOnOutsidePress:a,floatingOffset:_,open:d,onOpenChange:P,transitionConfig:v,dividerColor:x,children:u,resizeConfig:q,sizeStyle:b,skipMountAnimation:y,container:r,triggerRef:n,...j})=>{const m=l==="isModal"||l==="alert",I=g.useCallback(o=>{const F=(n==null?void 0:n.current)??null;return!(F&&o.target instanceof Node&&F.contains(o.target))},[n]),U=g.useMemo(()=>{const o=S.getPanelDismissConfig(l,a);return!n||!(l==="isModal"||l!=="alert"&&!!a)?o:{...o??{},outsidePress:I}},[l,a,n,I]),N=M(p.styles[`${C}__overlay-divider`],p.styles[`${C}__overlay-divider--${e}`]);return i.jsx(w.PanelContext.Provider,{value:s,children:i.jsx(k.FloatingUIRoot,{open:d,onOpenChange:P,portalled:r?{root:r}:!0,transitionConfig:v,dismiss:U,focusConfiguration:m?!0:{modal:!1,closeOnFocusOut:!1},children:i.jsx(R,{panelClassName:t,resolvedPosition:e,showDivider:c,dividerColor:x,floatingOffset:_,overlayDividerClassName:N,isBlocking:m,resizeConfig:q,sizeStyle:b,skipMountAnimation:y,container:r,...j,role:l==="alert"?"alertdialog":"dialog","aria-modal":m||void 0,children:u})})})};exports.OverlayPanel=E;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UseTransitionStylesProps } from '@floating-ui/react';
|
|
2
|
+
import { ComponentPropsWithoutRef, CSSProperties, RefObject } from 'react';
|
|
2
3
|
import { PanelDividerColor, PanelModalType, PanelPosition, PanelResizeConfig, ResolvedPanelOffset } from './Panel.types';
|
|
3
4
|
import { PanelContextValue } from './Panel.context';
|
|
4
5
|
import { FloatingUIProps } from '../../FloatingUI/FloatingUI.context';
|
|
@@ -16,8 +17,23 @@ type OverlayPanelProps = {
|
|
|
16
17
|
children: React.ReactNode;
|
|
17
18
|
dividerColor?: PanelDividerColor;
|
|
18
19
|
resizeConfig?: PanelResizeConfig;
|
|
20
|
+
/** Forwarded from Panel: CSS custom-property override for the panel size. */
|
|
21
|
+
sizeStyle?: CSSProperties;
|
|
19
22
|
/** Forwarded from Panel: when true, suppress the slide-in animation on this mount. */
|
|
20
23
|
skipMountAnimation?: boolean;
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Portal target; when set, panel renders inside this element using position: absolute.
|
|
26
|
+
* `undefined` means no container (full-screen). A pending container is handled upstream:
|
|
27
|
+
* Panel returns null before reaching here, so this is never `null`.
|
|
28
|
+
*/
|
|
29
|
+
container?: HTMLElement;
|
|
30
|
+
/**
|
|
31
|
+
* The element that opens the panel; clicks on it are excluded from outside-press
|
|
32
|
+
* dismissal so it can toggle the panel without the close immediately re-firing.
|
|
33
|
+
* Focus returns to the previously-focused element (typically this trigger) on close.
|
|
34
|
+
* No effect on `kind="inline"`.
|
|
35
|
+
*/
|
|
36
|
+
triggerRef?: RefObject<HTMLElement | null>;
|
|
37
|
+
} & ComponentPropsWithoutRef<'aside'>;
|
|
38
|
+
export declare const OverlayPanel: ({ contextValue, panelClassName, resolvedPosition, showDivider, modalType, closeOnOutsidePress, floatingOffset, open, onOpenChange, transitionConfig, dividerColor, children, resizeConfig, sizeStyle, skipMountAnimation, container, triggerRef, ...props }: OverlayPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
39
|
export {};
|