@jfrader/ui 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +123 -2
- package/dist/accordion-Dl-kvgPQ.js +168 -0
- package/dist/accordion.js +1 -0
- package/dist/alert-BzntPa_5.js +129 -0
- package/dist/alert.js +1 -0
- package/dist/avatar-Dk2ES3ru.js +124 -0
- package/dist/avatar.js +1 -0
- package/dist/badge-DZefC7rm.js +102 -0
- package/dist/badge.js +1 -0
- package/dist/breadcrumbs-5MCZ_Jr3.js +125 -0
- package/dist/breadcrumbs.js +1 -0
- package/dist/button-qy-50NPd.js +187 -0
- package/dist/button.js +1 -0
- package/dist/calendar-DcCAiN3b.js +372 -0
- package/dist/calendar.js +1 -0
- package/dist/card-L-Z_1vZN.js +120 -0
- package/dist/card.js +1 -0
- package/dist/checkbox-B7em7B-6.js +134 -0
- package/dist/checkbox.js +1 -0
- package/dist/choice-control-DCyQ_hVw.js +35 -0
- package/dist/collection-registry-C2jnQa7X.js +97 -0
- package/dist/combobox-DQcXR94r.js +301 -0
- package/dist/combobox.js +1 -0
- package/dist/command-palette-BRJ8A5De.js +328 -0
- package/dist/command-palette.js +1 -0
- package/dist/container-COHiEjI8.js +34 -0
- package/dist/container.js +1 -0
- package/dist/css-CW_HG55W.js +1 -0
- package/dist/date-picker-D1GwiRB9.js +239 -0
- package/dist/date-picker.js +1 -0
- package/dist/dialog-CYf9fCZO.js +175 -0
- package/dist/dialog.js +1 -0
- package/dist/disclosure-caret-BC6P8AsM.js +13 -0
- package/dist/divider-bi7OgCI5.js +76 -0
- package/dist/divider.js +1 -0
- package/dist/field-anatomy-DKkB268x.js +104 -0
- package/dist/flex-CDFDDaiu.js +21 -0
- package/dist/flex.js +1 -0
- package/dist/focus-ring-qOS3rPlM.js +11 -0
- package/dist/icon-wrapper-BKo4FI-O.js +12 -0
- package/dist/index.js +37 -0
- package/dist/kbd-DpiJgDJ2.js +55 -0
- package/dist/kbd.js +1 -0
- package/dist/layout-style-B_6YHQ6Q.js +56 -0
- package/dist/loading-ring-CTpT-IrT.js +18 -0
- package/dist/media-8K3xDAxM.js +4 -0
- package/dist/menu-A9fZUaAG.js +186 -0
- package/dist/menu.js +1 -0
- package/dist/navigation-Cemnmc_J.js +174 -0
- package/dist/navigation.js +1 -0
- package/dist/pagination-orCjUsn_.js +148 -0
- package/dist/pagination.js +1 -0
- package/dist/part-id-Bg1LSlk7.js +4 -0
- package/dist/pill-Dg2JJHHW.js +49 -0
- package/dist/pill.js +1 -0
- package/dist/popover-D_YU34WS.js +97 -0
- package/dist/popover.js +1 -0
- package/dist/progress-XdvBG0Vv.js +83 -0
- package/dist/progress.js +1 -0
- package/dist/radio-group-CxMJ2Vq7.js +130 -0
- package/dist/radio-group.js +1 -0
- package/dist/renderable-DwPvt1I8.js +6 -0
- package/dist/roving-focus-DeEZ55-T.js +35 -0
- package/dist/select-mwFbmzsn.js +256 -0
- package/dist/select.js +1 -0
- package/dist/skeleton-qas9ZKK9.js +47 -0
- package/dist/skeleton.js +1 -0
- package/dist/spinner-ros2CfIf.js +49 -0
- package/dist/spinner.js +1 -0
- package/dist/stack-Hs8THnIL.js +20 -0
- package/dist/stack.js +1 -0
- package/dist/surface-Bo_aSQOb.js +18 -0
- package/dist/switch-E375Bz4X.js +135 -0
- package/dist/switch.js +1 -0
- package/dist/tabs-CBwRiuul.js +173 -0
- package/dist/tabs.js +1 -0
- package/dist/text-field-BlP8qGn_.js +73 -0
- package/dist/text-field.js +1 -0
- package/dist/textarea-CUG26CH2.js +83 -0
- package/dist/textarea.js +1 -0
- package/dist/theme-root-CrdzwfSo.js +20 -0
- package/dist/theme-root.js +1 -0
- package/dist/toast-D_dnqnn-.js +270 -0
- package/dist/toast.js +1 -0
- package/dist/toggle-group-B7gXCea8.js +150 -0
- package/dist/toggle-group.js +1 -0
- package/dist/tooltip-BJ2hLV1b.js +92 -0
- package/dist/tooltip.js +1 -0
- package/dist/trigger-style-f54idgjT.js +35 -0
- package/dist/types/components/accordion/accordion.d.ts +33 -0
- package/dist/types/components/accordion/index.d.ts +2 -0
- package/dist/types/components/alert/alert.d.ts +23 -0
- package/dist/types/components/alert/index.d.ts +2 -0
- package/dist/types/components/avatar/avatar.d.ts +23 -0
- package/dist/types/components/avatar/index.d.ts +2 -0
- package/dist/types/components/badge/badge.d.ts +36 -0
- package/dist/types/components/badge/index.d.ts +2 -0
- package/dist/types/components/breadcrumbs/breadcrumbs.d.ts +15 -0
- package/dist/types/components/breadcrumbs/index.d.ts +2 -0
- package/dist/types/components/button/button.d.ts +34 -0
- package/dist/types/components/button/index.d.ts +2 -0
- package/dist/types/components/calendar/calendar.d.ts +28 -0
- package/dist/types/components/calendar/calendar.styles.d.ts +9 -0
- package/dist/types/components/calendar/calendar.utils.d.ts +37 -0
- package/dist/types/components/calendar/index.d.ts +2 -0
- package/dist/types/components/card/card.d.ts +34 -0
- package/dist/types/components/card/index.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.d.ts +21 -0
- package/dist/types/components/checkbox/index.d.ts +2 -0
- package/dist/types/components/combobox/combobox.d.ts +44 -0
- package/dist/types/components/combobox/index.d.ts +2 -0
- package/dist/types/components/command-palette/command-palette.d.ts +47 -0
- package/dist/types/components/command-palette/command-palette.styles.d.ts +8 -0
- package/dist/types/components/command-palette/index.d.ts +2 -0
- package/dist/types/components/container/container.d.ts +14 -0
- package/dist/types/components/container/index.d.ts +3 -0
- package/dist/types/components/date-picker/date-picker.d.ts +39 -0
- package/dist/types/components/date-picker/index.d.ts +2 -0
- package/dist/types/components/dialog/dialog.d.ts +61 -0
- package/dist/types/components/dialog/index.d.ts +2 -0
- package/dist/types/components/divider/divider.d.ts +14 -0
- package/dist/types/components/divider/index.d.ts +2 -0
- package/dist/types/components/field/field-anatomy.d.ts +49 -0
- package/dist/types/components/flex/flex.d.ts +4 -0
- package/dist/types/components/flex/index.d.ts +3 -0
- package/dist/types/components/kbd/index.d.ts +2 -0
- package/dist/types/components/kbd/kbd.d.ts +6 -0
- package/dist/types/components/menu/index.d.ts +2 -0
- package/dist/types/components/menu/menu.d.ts +29 -0
- package/dist/types/components/navigation/index.d.ts +2 -0
- package/dist/types/components/navigation/navigation.d.ts +24 -0
- package/dist/types/components/pagination/index.d.ts +2 -0
- package/dist/types/components/pagination/pagination.d.ts +14 -0
- package/dist/types/components/pill/index.d.ts +2 -0
- package/dist/types/components/pill/pill.d.ts +6 -0
- package/dist/types/components/popover/index.d.ts +2 -0
- package/dist/types/components/popover/popover.d.ts +19 -0
- package/dist/types/components/progress/index.d.ts +2 -0
- package/dist/types/components/progress/progress.d.ts +19 -0
- package/dist/types/components/radio-group/index.d.ts +2 -0
- package/dist/types/components/radio-group/radio-group.d.ts +29 -0
- package/dist/types/components/select/index.d.ts +2 -0
- package/dist/types/components/select/select.d.ts +38 -0
- package/dist/types/components/skeleton/index.d.ts +2 -0
- package/dist/types/components/skeleton/skeleton.d.ts +11 -0
- package/dist/types/components/spinner/index.d.ts +2 -0
- package/dist/types/components/spinner/spinner.d.ts +8 -0
- package/dist/types/components/stack/index.d.ts +3 -0
- package/dist/types/components/stack/stack.d.ts +7 -0
- package/dist/types/components/switch/index.d.ts +2 -0
- package/dist/types/components/switch/switch.d.ts +20 -0
- package/dist/types/components/tabs/index.d.ts +2 -0
- package/dist/types/components/tabs/tabs.d.ts +22 -0
- package/dist/types/components/text-field/index.d.ts +2 -0
- package/dist/types/components/text-field/text-field.d.ts +14 -0
- package/dist/types/components/textarea/index.d.ts +2 -0
- package/dist/types/components/textarea/textarea.d.ts +17 -0
- package/dist/types/components/theme-root/index.d.ts +2 -0
- package/dist/types/components/theme-root/theme-root.d.ts +7 -0
- package/dist/types/components/toast/index.d.ts +2 -0
- package/dist/types/components/toast/toast.d.ts +37 -0
- package/dist/types/components/toggle-group/index.d.ts +2 -0
- package/dist/types/components/toggle-group/toggle-group.d.ts +29 -0
- package/dist/types/components/tooltip/index.d.ts +2 -0
- package/dist/types/components/tooltip/tooltip.d.ts +23 -0
- package/dist/types/index.d.ts +36 -0
- package/dist/types/overlay/use-native-dialog.d.ts +39 -0
- package/dist/types/overlay/use-overlay-floating.d.ts +11 -0
- package/dist/types/overlay/use-scroll-lock.d.ts +5 -0
- package/dist/types/styling/choice-control.d.ts +8 -0
- package/dist/types/styling/css.d.ts +2 -0
- package/dist/types/styling/disclosure-caret.d.ts +9 -0
- package/dist/types/styling/focus-ring.d.ts +10 -0
- package/dist/types/styling/icon-wrapper.d.ts +1 -0
- package/dist/types/styling/input-control.d.ts +1 -0
- package/dist/types/styling/layout-style.d.ts +26 -0
- package/dist/types/styling/listbox-style.d.ts +12 -0
- package/dist/types/styling/loading-ring.d.ts +14 -0
- package/dist/types/styling/media.d.ts +2 -0
- package/dist/types/styling/surface.d.ts +19 -0
- package/dist/types/styling/trigger-style.d.ts +1 -0
- package/dist/types/styling/visually-hidden.d.ts +1 -0
- package/dist/types/utils/collection-registry.d.ts +41 -0
- package/dist/types/utils/part-id.d.ts +2 -0
- package/dist/types/utils/renderable.d.ts +3 -0
- package/dist/types/utils/roving-focus.d.ts +18 -0
- package/dist/types/utils/use-controlled-state.d.ts +7 -0
- package/dist/types/utils/use-latest-callback.d.ts +10 -0
- package/dist/use-controlled-state-DQXkiTQI.js +20 -0
- package/dist/use-native-dialog-BCp1chwO.js +83 -0
- package/dist/use-overlay-floating-CsZd3qxa.js +18 -0
- package/dist/visually-hidden-BXVyhj0y.js +16 -0
- package/package.json +198 -3
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Raised panel: surface color, hairline border and the base text setup. */
|
|
2
|
+
export declare const raisedSurface: {
|
|
3
|
+
readonly boxSizing: 'border-box';
|
|
4
|
+
readonly backgroundColor: "var(--ui-color-surface-raised)";
|
|
5
|
+
readonly border: "1px solid var(--ui-color-border)";
|
|
6
|
+
readonly color: "var(--ui-color-text)";
|
|
7
|
+
readonly fontFamily: "var(--ui-font-sans)";
|
|
8
|
+
readonly lineHeight: "var(--ui-line-height-base)";
|
|
9
|
+
};
|
|
10
|
+
/** Native `<dialog>` shell reset with the scrim backdrop; the panel inside draws the surface. */
|
|
11
|
+
export declare const modalShellReset: {
|
|
12
|
+
readonly border: 0;
|
|
13
|
+
readonly padding: 0;
|
|
14
|
+
readonly background: 'transparent';
|
|
15
|
+
readonly color: 'inherit';
|
|
16
|
+
readonly '&::backdrop': {
|
|
17
|
+
readonly backgroundColor: "var(--ui-color-scrim)";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const triggerStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const visuallyHiddenStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type MutableRefObject, type RefObject } from 'react';
|
|
2
|
+
import { useListItem } from '@floating-ui/react';
|
|
3
|
+
export interface CollectionRecord {
|
|
4
|
+
/** The item's FloatingList index; -1 until the list has indexed it. */
|
|
5
|
+
index: number;
|
|
6
|
+
/** The item's rendered text. */
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export interface CollectionRegistration<R extends CollectionRecord> {
|
|
10
|
+
register: (value: string, record: R) => void;
|
|
11
|
+
unregister: (value: string) => void;
|
|
12
|
+
}
|
|
13
|
+
/** Index → label lookup for typeahead; a `null` entry is never matched. */
|
|
14
|
+
export interface LabelLookup {
|
|
15
|
+
labelsRef: MutableRefObject<Array<string | null>>;
|
|
16
|
+
/** False keeps the item out of the lookup (e.g. disabled options). */
|
|
17
|
+
include: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** The DOM id of a registered item. */
|
|
20
|
+
export declare const collectionItemId: (baseId: string, value: string) => string;
|
|
21
|
+
/**
|
|
22
|
+
* Root side: the registered records keyed by value, and a stable registration so items'
|
|
23
|
+
* effects do not re-run when the registry changes. Unchanged records keep the same map.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useCollectionRegistry<R extends CollectionRecord>(): readonly [ReadonlyMap<string, R>, CollectionRegistration<R>];
|
|
26
|
+
export declare function useCollectionListItem(options?: Parameters<typeof useListItem>[0]): {
|
|
27
|
+
ref: (node: HTMLElement | null) => void;
|
|
28
|
+
index: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function useCollectionIndexRegistration(index: number, include: boolean, indices: Set<number>): void;
|
|
31
|
+
/**
|
|
32
|
+
* Item side: joins the enclosing FloatingList and, on every commit, registers the record built
|
|
33
|
+
* from the current index and the label read from `labelRef`'s text. Layout effects so the root
|
|
34
|
+
* sees the record before paint; registering an unchanged record is a no-op. The item is
|
|
35
|
+
* unregistered when its value changes or it unmounts. With `labelLookup`, the label is also
|
|
36
|
+
* mirrored into an index-addressed lookup and cleared from its slot on cleanup.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useCollectionItem<R extends CollectionRecord>(value: string, registration: CollectionRegistration<R>, labelRef: RefObject<HTMLElement | null>, toRecord: (index: number, label: string) => R, labelLookup?: LabelLookup): {
|
|
39
|
+
ref: (node: HTMLElement | null) => void;
|
|
40
|
+
index: number;
|
|
41
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { KeyboardEvent } from 'react';
|
|
2
|
+
export type RovingOrientation = 'horizontal' | 'vertical';
|
|
3
|
+
export interface OwnedItemsQuery {
|
|
4
|
+
/** Matches the enabled items, e.g. `'[role="tab"]:not([disabled])'`. */
|
|
5
|
+
itemSelector: string;
|
|
6
|
+
/** Matches the owning container, so items of a nested instance are excluded. */
|
|
7
|
+
ownerSelector: string;
|
|
8
|
+
}
|
|
9
|
+
/** Enabled items inside `container` whose nearest owner is `container` itself. */
|
|
10
|
+
export declare function queryOwnedItems(container: HTMLElement, { itemSelector, ownerSelector }: OwnedItemsQuery): HTMLElement[];
|
|
11
|
+
/** The item whose `data-value` equals `value`; never matches a missing value. */
|
|
12
|
+
export declare function findByValue(items: readonly HTMLElement[], value: string | null | undefined): HTMLElement | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Moves focus among `container`'s owned items for arrow/Home/End keys, wrapping at the ends.
|
|
15
|
+
* Horizontal arrows swap under RTL (the container's computed direction). Keys that do not
|
|
16
|
+
* move, or events from outside the owned items, are left untouched.
|
|
17
|
+
*/
|
|
18
|
+
export declare function moveRovingFocus(event: KeyboardEvent<HTMLElement>, container: HTMLElement, orientation: RovingOrientation, query: OwnedItemsQuery): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One state authority for controlled/uncontrolled components.
|
|
3
|
+
* `value === undefined` means uncontrolled; internal state seeds from `defaultValue`.
|
|
4
|
+
* Requests dedupe against the current value and notify only through `onChange`.
|
|
5
|
+
* Do not switch modes during an instance's lifetime (see SKILL.md §5).
|
|
6
|
+
*/
|
|
7
|
+
export declare function useControlledState<T>(value: T | undefined, defaultValue: T | undefined, onChange?: (next: T) => void): readonly [T | undefined, (next: T) => void];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A stable function that forwards to the latest `callback` (a no-op while it is undefined), so
|
|
3
|
+
* an inline consumer callback does not change the identity of the memoized values it feeds.
|
|
4
|
+
* No render-time ref writes: an abandoned render cannot leak its callback.
|
|
5
|
+
* `useControlledState`'s setter and Combobox's `onInputChange` call this only from event
|
|
6
|
+
* handlers, after commit/effects, so they see the current callback. A child layout effect
|
|
7
|
+
* in the commit that swaps the callback can still see the previous one; that is acceptable
|
|
8
|
+
* for these event-only call sites. Initializing the ref keeps pre-effect mount calls correct.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useLatestCallback<Args extends unknown[]>(callback: ((...args: Args) => void) | undefined): (...args: Args) => void | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
+
//#region src/utils/use-latest-callback.ts
|
|
3
|
+
function i(r) {
|
|
4
|
+
let i = n(r);
|
|
5
|
+
return t(() => {
|
|
6
|
+
i.current = r;
|
|
7
|
+
}), e((...e) => i.current?.(...e), []);
|
|
8
|
+
}
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/utils/use-controlled-state.ts
|
|
11
|
+
function a(t, a, o) {
|
|
12
|
+
let s = t !== void 0, [c, l] = r(a), u = s ? t : c, d = n(u);
|
|
13
|
+
d.current = u;
|
|
14
|
+
let f = i(o);
|
|
15
|
+
return [u, e((e) => {
|
|
16
|
+
e !== d.current && (s || l(e), f(e));
|
|
17
|
+
}, [s, f])];
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { i as n, a as t };
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useImperativeHandle as n, useRef as r, useState as i } from "react";
|
|
2
|
+
//#region src/overlay/use-scroll-lock.ts
|
|
3
|
+
var a = /* @__PURE__ */ new Map();
|
|
4
|
+
function o(e, n) {
|
|
5
|
+
let i = r(n);
|
|
6
|
+
i.current = n, t(() => {
|
|
7
|
+
if (!e) return;
|
|
8
|
+
let t = i.current?.() ?? (typeof document > "u" ? void 0 : document);
|
|
9
|
+
if (!t) return;
|
|
10
|
+
let n = a.get(t);
|
|
11
|
+
return n ? n.count += 1 : (a.set(t, {
|
|
12
|
+
count: 1,
|
|
13
|
+
rootOverflow: t.documentElement.style.overflow,
|
|
14
|
+
bodyOverflow: t.body.style.overflow
|
|
15
|
+
}), t.documentElement.style.overflow = "hidden", t.body.style.overflow = "hidden"), () => {
|
|
16
|
+
let e = a.get(t);
|
|
17
|
+
e && (--e.count, !(e.count > 0) && (t.documentElement.style.overflow = e.rootOverflow, t.body.style.overflow = e.bodyOverflow, a.delete(t)));
|
|
18
|
+
};
|
|
19
|
+
}, [e]);
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region src/overlay/use-native-dialog.ts
|
|
23
|
+
function s(e, t) {
|
|
24
|
+
e && e.open && typeof e.requestClose == "function" ? e.requestClose() : t(!1);
|
|
25
|
+
}
|
|
26
|
+
function c(t, n) {
|
|
27
|
+
let [a, o] = i(0), c = r(null), l = e((e) => {
|
|
28
|
+
c.current = e;
|
|
29
|
+
}, []), u = e((e) => {
|
|
30
|
+
let r = c.current?.open ?? !1;
|
|
31
|
+
(e !== t || r !== t) && (e === t ? o((e) => e + 1) : n(e));
|
|
32
|
+
}, [t, n]);
|
|
33
|
+
return {
|
|
34
|
+
dialogElementRef: c,
|
|
35
|
+
setDialogElement: l,
|
|
36
|
+
setOpen: u,
|
|
37
|
+
requestClose: e(() => {
|
|
38
|
+
s(c.current, u);
|
|
39
|
+
}, [u]),
|
|
40
|
+
repairToken: a
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function l(e) {
|
|
44
|
+
let { open: t, ...n } = e;
|
|
45
|
+
return n;
|
|
46
|
+
}
|
|
47
|
+
function u({ open: a, setOpen: s, requestClose: c, repairToken: l, setDialogElement: u }, { onCancel: d, onClick: f, onClose: p }, m, h) {
|
|
48
|
+
let g = r(null), _ = h ?? g;
|
|
49
|
+
n(m, () => _.current, []);
|
|
50
|
+
let v = r(null), y = r(!1), [b, x] = i(!1), S = e((e) => {
|
|
51
|
+
_.current = e, u(e);
|
|
52
|
+
}, [u]);
|
|
53
|
+
return o(b, () => _.current?.ownerDocument), t(() => {
|
|
54
|
+
let e = _.current;
|
|
55
|
+
if (e) {
|
|
56
|
+
if (a && !e.open) {
|
|
57
|
+
v.current = e.ownerDocument.activeElement ?? null, y.current = !0;
|
|
58
|
+
try {
|
|
59
|
+
e.showModal();
|
|
60
|
+
} catch {}
|
|
61
|
+
x(e.open);
|
|
62
|
+
} else !a && e.open && (e.close(), y.current = !1, x(!1));
|
|
63
|
+
}
|
|
64
|
+
}, [a, l]), t(() => () => {
|
|
65
|
+
let e = v.current;
|
|
66
|
+
y.current && e && e.isConnected && typeof e.focus == "function" && e.focus();
|
|
67
|
+
}, []), {
|
|
68
|
+
ref: S,
|
|
69
|
+
onCancel: (e) => {
|
|
70
|
+
d?.(e);
|
|
71
|
+
let t = e.defaultPrevented;
|
|
72
|
+
e.preventDefault(), t || s(!1);
|
|
73
|
+
},
|
|
74
|
+
onClick: (e) => {
|
|
75
|
+
f?.(e), e.target === _.current && !e.defaultPrevented && c();
|
|
76
|
+
},
|
|
77
|
+
onClose: (e) => {
|
|
78
|
+
y.current = !1, p?.(e), x(!1), a && s(!1);
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
export { c as i, s as n, u as r, l as t };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { autoUpdate as e, flip as t, offset as n, shift as r, useFloating as i } from "@floating-ui/react";
|
|
2
|
+
//#region src/overlay/use-overlay-floating.ts
|
|
3
|
+
var a = 8, o = 8;
|
|
4
|
+
function s({ open: s, onOpenChange: c, placement: l }) {
|
|
5
|
+
return i({
|
|
6
|
+
open: s,
|
|
7
|
+
onOpenChange: c,
|
|
8
|
+
placement: l,
|
|
9
|
+
middleware: [
|
|
10
|
+
n(a),
|
|
11
|
+
t({ padding: o }),
|
|
12
|
+
r({ padding: o })
|
|
13
|
+
],
|
|
14
|
+
whileElementsMounted: e
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { s as t };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { t as e } from "./css-CW_HG55W.js";
|
|
2
|
+
//#region src/styling/visually-hidden.ts
|
|
3
|
+
var t = e({
|
|
4
|
+
position: "absolute",
|
|
5
|
+
inlineSize: "1px",
|
|
6
|
+
blockSize: "1px",
|
|
7
|
+
padding: 0,
|
|
8
|
+
margin: "-1px",
|
|
9
|
+
overflow: "hidden",
|
|
10
|
+
clip: "rect(0, 0, 0, 0)",
|
|
11
|
+
clipPath: "inset(50%)",
|
|
12
|
+
whiteSpace: "nowrap",
|
|
13
|
+
border: 0
|
|
14
|
+
});
|
|
15
|
+
//#endregion
|
|
16
|
+
export { t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,201 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jfrader/ui",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "React components styled with Emotion and themed through CSS custom properties.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"react",
|
|
7
|
+
"components",
|
|
8
|
+
"design-system",
|
|
9
|
+
"emotion",
|
|
10
|
+
"accessibility"
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/jfrader/jfrader-ui/tree/master/packages/ui#readme",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/jfrader/jfrader-ui.git",
|
|
16
|
+
"directory": "packages/ui"
|
|
17
|
+
},
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"files": [
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/types/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./accordion": {
|
|
30
|
+
"types": "./dist/types/components/accordion/index.d.ts",
|
|
31
|
+
"import": "./dist/accordion.js"
|
|
32
|
+
},
|
|
33
|
+
"./alert": {
|
|
34
|
+
"types": "./dist/types/components/alert/index.d.ts",
|
|
35
|
+
"import": "./dist/alert.js"
|
|
36
|
+
},
|
|
37
|
+
"./avatar": {
|
|
38
|
+
"types": "./dist/types/components/avatar/index.d.ts",
|
|
39
|
+
"import": "./dist/avatar.js"
|
|
40
|
+
},
|
|
41
|
+
"./badge": {
|
|
42
|
+
"types": "./dist/types/components/badge/index.d.ts",
|
|
43
|
+
"import": "./dist/badge.js"
|
|
44
|
+
},
|
|
45
|
+
"./breadcrumbs": {
|
|
46
|
+
"types": "./dist/types/components/breadcrumbs/index.d.ts",
|
|
47
|
+
"import": "./dist/breadcrumbs.js"
|
|
48
|
+
},
|
|
49
|
+
"./button": {
|
|
50
|
+
"types": "./dist/types/components/button/index.d.ts",
|
|
51
|
+
"import": "./dist/button.js"
|
|
52
|
+
},
|
|
53
|
+
"./calendar": {
|
|
54
|
+
"types": "./dist/types/components/calendar/index.d.ts",
|
|
55
|
+
"import": "./dist/calendar.js"
|
|
56
|
+
},
|
|
57
|
+
"./card": {
|
|
58
|
+
"types": "./dist/types/components/card/index.d.ts",
|
|
59
|
+
"import": "./dist/card.js"
|
|
60
|
+
},
|
|
61
|
+
"./checkbox": {
|
|
62
|
+
"types": "./dist/types/components/checkbox/index.d.ts",
|
|
63
|
+
"import": "./dist/checkbox.js"
|
|
64
|
+
},
|
|
65
|
+
"./combobox": {
|
|
66
|
+
"types": "./dist/types/components/combobox/index.d.ts",
|
|
67
|
+
"import": "./dist/combobox.js"
|
|
68
|
+
},
|
|
69
|
+
"./command-palette": {
|
|
70
|
+
"types": "./dist/types/components/command-palette/index.d.ts",
|
|
71
|
+
"import": "./dist/command-palette.js"
|
|
72
|
+
},
|
|
73
|
+
"./container": {
|
|
74
|
+
"types": "./dist/types/components/container/index.d.ts",
|
|
75
|
+
"import": "./dist/container.js"
|
|
76
|
+
},
|
|
77
|
+
"./date-picker": {
|
|
78
|
+
"types": "./dist/types/components/date-picker/index.d.ts",
|
|
79
|
+
"import": "./dist/date-picker.js"
|
|
80
|
+
},
|
|
81
|
+
"./dialog": {
|
|
82
|
+
"types": "./dist/types/components/dialog/index.d.ts",
|
|
83
|
+
"import": "./dist/dialog.js"
|
|
84
|
+
},
|
|
85
|
+
"./divider": {
|
|
86
|
+
"types": "./dist/types/components/divider/index.d.ts",
|
|
87
|
+
"import": "./dist/divider.js"
|
|
88
|
+
},
|
|
89
|
+
"./flex": {
|
|
90
|
+
"types": "./dist/types/components/flex/index.d.ts",
|
|
91
|
+
"import": "./dist/flex.js"
|
|
92
|
+
},
|
|
93
|
+
"./kbd": {
|
|
94
|
+
"types": "./dist/types/components/kbd/index.d.ts",
|
|
95
|
+
"import": "./dist/kbd.js"
|
|
96
|
+
},
|
|
97
|
+
"./menu": {
|
|
98
|
+
"types": "./dist/types/components/menu/index.d.ts",
|
|
99
|
+
"import": "./dist/menu.js"
|
|
100
|
+
},
|
|
101
|
+
"./navigation": {
|
|
102
|
+
"types": "./dist/types/components/navigation/index.d.ts",
|
|
103
|
+
"import": "./dist/navigation.js"
|
|
104
|
+
},
|
|
105
|
+
"./pagination": {
|
|
106
|
+
"types": "./dist/types/components/pagination/index.d.ts",
|
|
107
|
+
"import": "./dist/pagination.js"
|
|
108
|
+
},
|
|
109
|
+
"./pill": {
|
|
110
|
+
"types": "./dist/types/components/pill/index.d.ts",
|
|
111
|
+
"import": "./dist/pill.js"
|
|
112
|
+
},
|
|
113
|
+
"./popover": {
|
|
114
|
+
"types": "./dist/types/components/popover/index.d.ts",
|
|
115
|
+
"import": "./dist/popover.js"
|
|
116
|
+
},
|
|
117
|
+
"./progress": {
|
|
118
|
+
"types": "./dist/types/components/progress/index.d.ts",
|
|
119
|
+
"import": "./dist/progress.js"
|
|
120
|
+
},
|
|
121
|
+
"./radio-group": {
|
|
122
|
+
"types": "./dist/types/components/radio-group/index.d.ts",
|
|
123
|
+
"import": "./dist/radio-group.js"
|
|
124
|
+
},
|
|
125
|
+
"./select": {
|
|
126
|
+
"types": "./dist/types/components/select/index.d.ts",
|
|
127
|
+
"import": "./dist/select.js"
|
|
128
|
+
},
|
|
129
|
+
"./skeleton": {
|
|
130
|
+
"types": "./dist/types/components/skeleton/index.d.ts",
|
|
131
|
+
"import": "./dist/skeleton.js"
|
|
132
|
+
},
|
|
133
|
+
"./spinner": {
|
|
134
|
+
"types": "./dist/types/components/spinner/index.d.ts",
|
|
135
|
+
"import": "./dist/spinner.js"
|
|
136
|
+
},
|
|
137
|
+
"./stack": {
|
|
138
|
+
"types": "./dist/types/components/stack/index.d.ts",
|
|
139
|
+
"import": "./dist/stack.js"
|
|
140
|
+
},
|
|
141
|
+
"./switch": {
|
|
142
|
+
"types": "./dist/types/components/switch/index.d.ts",
|
|
143
|
+
"import": "./dist/switch.js"
|
|
144
|
+
},
|
|
145
|
+
"./tabs": {
|
|
146
|
+
"types": "./dist/types/components/tabs/index.d.ts",
|
|
147
|
+
"import": "./dist/tabs.js"
|
|
148
|
+
},
|
|
149
|
+
"./text-field": {
|
|
150
|
+
"types": "./dist/types/components/text-field/index.d.ts",
|
|
151
|
+
"import": "./dist/text-field.js"
|
|
152
|
+
},
|
|
153
|
+
"./textarea": {
|
|
154
|
+
"types": "./dist/types/components/textarea/index.d.ts",
|
|
155
|
+
"import": "./dist/textarea.js"
|
|
156
|
+
},
|
|
157
|
+
"./theme-root": {
|
|
158
|
+
"types": "./dist/types/components/theme-root/index.d.ts",
|
|
159
|
+
"import": "./dist/theme-root.js"
|
|
160
|
+
},
|
|
161
|
+
"./toast": {
|
|
162
|
+
"types": "./dist/types/components/toast/index.d.ts",
|
|
163
|
+
"import": "./dist/toast.js"
|
|
164
|
+
},
|
|
165
|
+
"./toggle-group": {
|
|
166
|
+
"types": "./dist/types/components/toggle-group/index.d.ts",
|
|
167
|
+
"import": "./dist/toggle-group.js"
|
|
168
|
+
},
|
|
169
|
+
"./tooltip": {
|
|
170
|
+
"types": "./dist/types/components/tooltip/index.d.ts",
|
|
171
|
+
"import": "./dist/tooltip.js"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"publishConfig": {
|
|
175
|
+
"access": "public"
|
|
176
|
+
},
|
|
177
|
+
"dependencies": {
|
|
178
|
+
"@emotion/react": "^11.14.0",
|
|
179
|
+
"@floating-ui/react": "^0.27.20",
|
|
180
|
+
"@jfrader/tokens": "0.1.1"
|
|
181
|
+
},
|
|
182
|
+
"peerDependencies": {
|
|
183
|
+
"react": ">=18.2.0",
|
|
184
|
+
"react-dom": ">=18.2.0"
|
|
185
|
+
},
|
|
186
|
+
"devDependencies": {
|
|
187
|
+
"@storybook/react-vite": "^10.6.1",
|
|
188
|
+
"@types/react": "^19.3.0",
|
|
189
|
+
"@types/react-dom": "^19.3.0",
|
|
190
|
+
"@vitejs/plugin-react": "^6.1.2",
|
|
191
|
+
"react": "^19.3.0",
|
|
192
|
+
"react-dom": "^19.3.0",
|
|
193
|
+
"storybook": "^10.6.1",
|
|
194
|
+
"typescript": "^7.0.2",
|
|
195
|
+
"vite": "^8.3.4"
|
|
196
|
+
},
|
|
197
|
+
"scripts": {
|
|
198
|
+
"build": "vite build --config vite.lib.config.ts && tsc -p tsconfig.build.json --emitDeclarationOnly --outDir dist/types",
|
|
199
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
200
|
+
}
|
|
6
201
|
}
|