@inkra/react 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +213 -2
- package/THIRD_PARTY_NOTICES.md +39 -0
- package/Yozai-OFL.txt +94 -0
- package/dist/Button.d.ts +36 -0
- package/dist/Button.js +89 -0
- package/dist/PencilIcon.d.ts +22 -0
- package/dist/PencilIcon.js +212 -0
- package/dist/PencilLine.d.ts +10 -0
- package/dist/PencilLine.js +85 -0
- package/dist/PencilSurface.d.ts +19 -0
- package/dist/PencilSurface.js +19 -0
- package/dist/PencilText.d.ts +16 -0
- package/dist/PencilText.js +205 -0
- package/dist/accordion/Accordion.d.ts +27 -0
- package/dist/accordion/Accordion.js +40 -0
- package/dist/accordion/index.d.ts +2 -0
- package/dist/accordion/index.js +1 -0
- package/dist/assets/ui-hand-yozai.woff2 +0 -0
- package/dist/breadcrumb/index.d.ts +16 -0
- package/dist/breadcrumb/index.js +25 -0
- package/dist/calendar/index.d.ts +21 -0
- package/dist/calendar/index.js +41 -0
- package/dist/content/index.d.ts +106 -0
- package/dist/content/index.js +80 -0
- package/dist/day-agenda/index.d.ts +43 -0
- package/dist/day-agenda/index.js +47 -0
- package/dist/day-agenda/layout.d.ts +20 -0
- package/dist/day-agenda/layout.js +60 -0
- package/dist/display/index.d.ts +32 -0
- package/dist/display/index.js +59 -0
- package/dist/dropdown-menu/index.d.ts +34 -0
- package/dist/dropdown-menu/index.js +40 -0
- package/dist/form/EditablePencilText.d.ts +13 -0
- package/dist/form/EditablePencilText.js +312 -0
- package/dist/form/Field.d.ts +13 -0
- package/dist/form/Field.js +26 -0
- package/dist/form/Input.d.ts +27 -0
- package/dist/form/Input.js +97 -0
- package/dist/form/InputAction.d.ts +7 -0
- package/dist/form/InputAction.js +24 -0
- package/dist/form/Textarea.d.ts +5 -0
- package/dist/form/Textarea.js +23 -0
- package/dist/form/context.d.ts +12 -0
- package/dist/form/context.js +10 -0
- package/dist/form/controlProps.d.ts +23 -0
- package/dist/form/controlProps.js +20 -0
- package/dist/form/index.d.ts +7 -0
- package/dist/form/index.js +3 -0
- package/dist/form/types.d.ts +6 -0
- package/dist/form/types.js +1 -0
- package/dist/images/layers-2x.png +0 -0
- package/dist/images/layers.png +0 -0
- package/dist/images/marker-icon.png +0 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +22 -0
- package/dist/input-number/index.d.ts +16 -0
- package/dist/input-number/index.js +77 -0
- package/dist/internal/InputActionContext.d.ts +1 -0
- package/dist/internal/InputActionContext.js +3 -0
- package/dist/internal/cache.d.ts +14 -0
- package/dist/internal/cache.js +54 -0
- package/dist/internal/line.d.ts +4 -0
- package/dist/internal/line.js +21 -0
- package/dist/internal/paper.d.ts +1 -0
- package/dist/internal/paper.js +65 -0
- package/dist/internal/random.d.ts +3 -0
- package/dist/internal/random.js +30 -0
- package/dist/internal/recovery.d.ts +1 -0
- package/dist/internal/recovery.js +52 -0
- package/dist/internal/stroke.d.ts +24 -0
- package/dist/internal/stroke.js +144 -0
- package/dist/internal/surfaceRenderer.d.ts +33 -0
- package/dist/internal/surfaceRenderer.js +175 -0
- package/dist/internal/textQueue.d.ts +1 -0
- package/dist/internal/textQueue.js +37 -0
- package/dist/internal/textRenderer.d.ts +27 -0
- package/dist/internal/textRenderer.js +213 -0
- package/dist/internal/travelIcons.d.ts +24 -0
- package/dist/internal/travelIcons.js +14 -0
- package/dist/internal/useBrowserLayoutEffect.d.ts +2 -0
- package/dist/internal/useBrowserLayoutEffect.js +3 -0
- package/dist/internal/usePencilSurface.d.ts +3 -0
- package/dist/internal/usePencilSurface.js +108 -0
- package/dist/internal/useSelectionDrawing.d.ts +2 -0
- package/dist/internal/useSelectionDrawing.js +86 -0
- package/dist/internal/wash.d.ts +16 -0
- package/dist/internal/wash.js +149 -0
- package/dist/journey-map/MapScale.d.ts +4 -0
- package/dist/journey-map/MapScale.js +52 -0
- package/dist/journey-map/index.d.ts +39 -0
- package/dist/journey-map/index.js +195 -0
- package/dist/journey-map/terrain.d.ts +8 -0
- package/dist/journey-map/terrain.js +127 -0
- package/dist/overlay/Overlay.d.ts +65 -0
- package/dist/overlay/Overlay.js +77 -0
- package/dist/overlay/Popover.d.ts +43 -0
- package/dist/overlay/Popover.js +45 -0
- package/dist/overlay/index.d.ts +4 -0
- package/dist/overlay/index.js +2 -0
- package/dist/overlay/themeBridge.d.ts +8 -0
- package/dist/overlay/themeBridge.js +98 -0
- package/dist/pencil.d.ts +10 -0
- package/dist/pencil.js +39 -0
- package/dist/select/MultipleSelect.d.ts +44 -0
- package/dist/select/MultipleSelect.js +124 -0
- package/dist/select/SearchableSelect.d.ts +45 -0
- package/dist/select/SearchableSelect.js +50 -0
- package/dist/select/Select.d.ts +109 -0
- package/dist/select/Select.js +205 -0
- package/dist/select/index.d.ts +4 -0
- package/dist/select/index.js +2 -0
- package/dist/selection/Checkbox.d.ts +9 -0
- package/dist/selection/Checkbox.js +37 -0
- package/dist/selection/RadioGroup.d.ts +23 -0
- package/dist/selection/RadioGroup.js +82 -0
- package/dist/selection/Switch.d.ts +8 -0
- package/dist/selection/Switch.js +36 -0
- package/dist/selection/index.d.ts +6 -0
- package/dist/selection/index.js +3 -0
- package/dist/selection/useNativeChecked.d.ts +13 -0
- package/dist/selection/useNativeChecked.js +27 -0
- package/dist/slider/index.d.ts +11 -0
- package/dist/slider/index.js +45 -0
- package/dist/styles.css +3663 -0
- package/dist/tabs/index.d.ts +22 -0
- package/dist/tabs/index.js +42 -0
- package/dist/tokens.css +355 -0
- package/dist/tooltip/Tooltip.d.ts +24 -0
- package/dist/tooltip/Tooltip.js +32 -0
- package/dist/tooltip/index.d.ts +2 -0
- package/dist/tooltip/index.js +1 -0
- package/package.json +100 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as Primitive from '@radix-ui/react-tabs';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export interface TabsProps extends Primitive.TabsProps {
|
|
4
|
+
size?: 'sm' | 'md' | 'lg';
|
|
5
|
+
animated?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface TabsListProps extends Primitive.TabsListProps {
|
|
8
|
+
align?: 'start' | 'center' | 'end';
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
divided?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface TabsTriggerProps extends Omit<Primitive.TabsTriggerProps, 'asChild'> {
|
|
13
|
+
startIcon?: ReactNode;
|
|
14
|
+
endIcon?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export type TabsContentProps = Primitive.TabsContentProps;
|
|
17
|
+
export declare const Tabs: {
|
|
18
|
+
Root: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
19
|
+
List: import("react").ForwardRefExoticComponent<TabsListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
|
+
Trigger: import("react").ForwardRefExoticComponent<TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
21
|
+
Content: import("react").ForwardRefExoticComponent<Primitive.TabsContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
22
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as Primitive from '@radix-ui/react-tabs';
|
|
3
|
+
import { createContext, forwardRef, useContext, useRef, useState } from 'react';
|
|
4
|
+
import { PencilSurface } from '../PencilSurface.js';
|
|
5
|
+
import { PencilText } from '../PencilText.js';
|
|
6
|
+
import { PencilLine } from '../PencilLine.js';
|
|
7
|
+
import { useSelectionDrawing } from '../internal/useSelectionDrawing.js';
|
|
8
|
+
const ValueContext = createContext(undefined);
|
|
9
|
+
const AnimatedContext = createContext(true);
|
|
10
|
+
const OrientationContext = createContext('horizontal');
|
|
11
|
+
const DividedContext = createContext(false);
|
|
12
|
+
const Root = forwardRef(function TabsRoot({ value, defaultValue, onValueChange, className, size = 'md', animated = true, orientation = 'horizontal', ...props }, ref) {
|
|
13
|
+
const [internal, setInternal] = useState(defaultValue);
|
|
14
|
+
const current = value === undefined ? internal : value;
|
|
15
|
+
const lastChange = useRef(current);
|
|
16
|
+
lastChange.current = current;
|
|
17
|
+
return _jsx(ValueContext.Provider, { value: current, children: _jsx(AnimatedContext.Provider, { value: animated, children: _jsx(OrientationContext.Provider, { value: orientation, children: _jsx(Primitive.Root, { ...props, orientation: orientation, ref: ref, "data-size": size, className: ['inkra-tabs', className].filter(Boolean).join(' '), value: current ?? '', onValueChange: next => {
|
|
18
|
+
// Pointer focus and pointer down can request the same tab before React renders.
|
|
19
|
+
if (lastChange.current === next)
|
|
20
|
+
return;
|
|
21
|
+
lastChange.current = next;
|
|
22
|
+
if (value === undefined)
|
|
23
|
+
setInternal(next);
|
|
24
|
+
onValueChange?.(next);
|
|
25
|
+
} }) }) }) });
|
|
26
|
+
});
|
|
27
|
+
const List = forwardRef(function TabsList({ className, align = 'start', fullWidth = false, divided = false, ...props }, ref) {
|
|
28
|
+
return _jsx(DividedContext.Provider, { value: divided, children: _jsx(Primitive.List, { ...props, ref: ref, "data-align": align, "data-full-width": fullWidth || undefined, "data-divided": divided || undefined, className: ['inkra-tabs__list', className].filter(Boolean).join(' ') }) });
|
|
29
|
+
});
|
|
30
|
+
const Trigger = forwardRef(function TabsTrigger({ value, className, children, startIcon, endIcon, ...props }, ref) {
|
|
31
|
+
const current = useContext(ValueContext);
|
|
32
|
+
const divided = useContext(DividedContext);
|
|
33
|
+
const orientation = useContext(OrientationContext);
|
|
34
|
+
const surface = useRef(null);
|
|
35
|
+
useSelectionDrawing(surface, current === value, useContext(AnimatedContext));
|
|
36
|
+
return _jsxs(Primitive.Trigger, { ...props, value: value, ref: ref, className: ['inkra-tabs__trigger', className].filter(Boolean).join(' '), children: [divided && _jsx(PencilLine, { className: "inkra-tabs__divider", orientation: orientation === 'horizontal' ? 'vertical' : 'horizontal', seed: `tab-divider-${value}` }), _jsx(PencilSurface, { as: "span", "aria-hidden": "true", className: "inkra-tabs__selection", variant: "selection", seed: `tab-${value}`, ref: surface }), _jsx(PencilSurface, { as: "span", "aria-hidden": "true", className: "inkra-tabs__focus-ring", variant: "outline", seed: `tab-${value}-focus` }), startIcon && _jsx("span", { className: "inkra-tabs__icon", "aria-hidden": "true", children: startIcon }), _jsx("span", { className: "inkra-tabs__label", children: typeof children === 'string' ? _jsx(PencilText, { children: children }) : children }), endIcon && _jsx("span", { className: "inkra-tabs__icon", "aria-hidden": "true", children: endIcon })] });
|
|
37
|
+
});
|
|
38
|
+
const Content = forwardRef(function TabsContent({ className, value, ...props }, ref) {
|
|
39
|
+
const current = useContext(ValueContext);
|
|
40
|
+
return _jsx(Primitive.Content, { ...props, value: value, ref: ref, hidden: current !== value, className: ['inkra-tabs__content', className].filter(Boolean).join(' ') });
|
|
41
|
+
});
|
|
42
|
+
export const Tabs = { Root, List, Trigger, Content };
|
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
:root,
|
|
2
|
+
[data-theme="light"],
|
|
3
|
+
[data-inkra-theme="light"],
|
|
4
|
+
[data-theme="auto"],
|
|
5
|
+
[data-inkra-theme="auto"] {
|
|
6
|
+
color-scheme: light;
|
|
7
|
+
|
|
8
|
+
--inkra-ocean-50: #c4e7f0;
|
|
9
|
+
--inkra-ocean-100: #b4dfe9;
|
|
10
|
+
--inkra-ocean-200: #a2d3df;
|
|
11
|
+
--inkra-ocean-300: #93c7d0;
|
|
12
|
+
--inkra-ocean-400: #78a9b3;
|
|
13
|
+
--inkra-ocean-500: #5ca0b0;
|
|
14
|
+
--inkra-ocean-600: #4b96aa;
|
|
15
|
+
--inkra-ocean-700: #3e7b8c;
|
|
16
|
+
--inkra-ocean-800: #305e6b;
|
|
17
|
+
--inkra-ocean-900: #294c56;
|
|
18
|
+
--inkra-ocean-950: #172f36;
|
|
19
|
+
--inkra-graphite-50: #f5f6f5;
|
|
20
|
+
--inkra-graphite-100: #e6e9e7;
|
|
21
|
+
--inkra-graphite-200: #ced4d0;
|
|
22
|
+
--inkra-graphite-300: #acb7b0;
|
|
23
|
+
--inkra-graphite-400: #85958c;
|
|
24
|
+
--inkra-graphite-500: #64766b;
|
|
25
|
+
--inkra-graphite-600: #4d5e54;
|
|
26
|
+
--inkra-graphite-700: #3b4b41;
|
|
27
|
+
--inkra-graphite-800: #293d33;
|
|
28
|
+
--inkra-graphite-900: #202d25;
|
|
29
|
+
--inkra-graphite-950: #141c17;
|
|
30
|
+
--inkra-cinnabar-50: #fcf3f0;
|
|
31
|
+
--inkra-cinnabar-100: #f6e2da;
|
|
32
|
+
--inkra-cinnabar-200: #ecc2b4;
|
|
33
|
+
--inkra-cinnabar-300: #dfa492;
|
|
34
|
+
--inkra-cinnabar-400: #cf806b;
|
|
35
|
+
--inkra-cinnabar-500: #b96350;
|
|
36
|
+
--inkra-cinnabar-600: #994f3f;
|
|
37
|
+
--inkra-cinnabar-700: #803c30;
|
|
38
|
+
--inkra-cinnabar-800: #672e26;
|
|
39
|
+
--inkra-cinnabar-900: #51251f;
|
|
40
|
+
--inkra-cinnabar-950: #311510;
|
|
41
|
+
--inkra-pine-50: #f1f7f0;
|
|
42
|
+
--inkra-pine-100: #e0eedc;
|
|
43
|
+
--inkra-pine-200: #c5ddbd;
|
|
44
|
+
--inkra-pine-300: #a4c69b;
|
|
45
|
+
--inkra-pine-400: #82ad7b;
|
|
46
|
+
--inkra-pine-500: #629568;
|
|
47
|
+
--inkra-pine-600: #4c7952;
|
|
48
|
+
--inkra-pine-700: #395e40;
|
|
49
|
+
--inkra-pine-800: #294a32;
|
|
50
|
+
--inkra-pine-900: #203b29;
|
|
51
|
+
--inkra-pine-950: #112218;
|
|
52
|
+
--inkra-warm-50: #fdfcf8;
|
|
53
|
+
--inkra-warm-100: #f8f5ec;
|
|
54
|
+
--inkra-warm-200: #f4f0e3;
|
|
55
|
+
--inkra-warm-300: #f2ead7;
|
|
56
|
+
--inkra-warm-400: #ddd6c4;
|
|
57
|
+
--inkra-warm-500: #b6b39d;
|
|
58
|
+
--inkra-warm-600: #8d8b78;
|
|
59
|
+
--inkra-warm-700: #5f6052;
|
|
60
|
+
--inkra-warm-800: #3f4037;
|
|
61
|
+
--inkra-warm-900: #292920;
|
|
62
|
+
--inkra-warm-950: #1b1b17;
|
|
63
|
+
|
|
64
|
+
--inkra-paper: #f4f0e3;
|
|
65
|
+
--inkra-surface: #fdfcf8;
|
|
66
|
+
--inkra-surface-muted: #f2ead7;
|
|
67
|
+
--inkra-ink: #172b21;
|
|
68
|
+
--inkra-ink-muted: #45594c;
|
|
69
|
+
--inkra-ink-subtle: #616d63;
|
|
70
|
+
--inkra-accent: #4b96aa;
|
|
71
|
+
--inkra-accent-strong: #305e6b;
|
|
72
|
+
--inkra-accent-soft: #78a9b3;
|
|
73
|
+
--inkra-on-accent: #173b45;
|
|
74
|
+
--inkra-coral: #994f3f;
|
|
75
|
+
--inkra-coral-soft: #d49b8b;
|
|
76
|
+
--inkra-blue: #4d91a0;
|
|
77
|
+
--inkra-blue-soft: #87bbc0;
|
|
78
|
+
--inkra-border: #99aa9b;
|
|
79
|
+
--inkra-border-strong: #536d59;
|
|
80
|
+
--inkra-focus: #305e6b;
|
|
81
|
+
--inkra-danger: #873e36;
|
|
82
|
+
--inkra-danger-soft: #d49b8b;
|
|
83
|
+
--inkra-success-pigment: #629568;
|
|
84
|
+
--inkra-success-foreground: #21472f;
|
|
85
|
+
--inkra-success-surface: var(--inkra-paper);
|
|
86
|
+
--inkra-warning-surface: var(--inkra-paper);
|
|
87
|
+
--inkra-danger-surface: var(--inkra-paper);
|
|
88
|
+
--inkra-info-surface: var(--inkra-paper);
|
|
89
|
+
--inkra-warning-pigment: #e6c17b;
|
|
90
|
+
--inkra-warning-foreground: #6b4d1f;
|
|
91
|
+
--inkra-danger-pigment: #d49b8b;
|
|
92
|
+
--inkra-danger-foreground: #873e36;
|
|
93
|
+
--inkra-info-pigment: #4b96aa;
|
|
94
|
+
--inkra-info-foreground: #173b45;
|
|
95
|
+
--inkra-selection: #d6b781;
|
|
96
|
+
--inkra-selection-pigment: #769566;
|
|
97
|
+
--inkra-selection-foreground: #173b2b;
|
|
98
|
+
--inkra-overlay: rgb(24 35 28 / 20%);
|
|
99
|
+
--inkra-shadow-overlay: 0 3px 12px rgb(24 35 28 / 20%);
|
|
100
|
+
|
|
101
|
+
--inkra-font-hand: "HanziPen SC", "Hannotate SC", "Kaiti SC", "STKaiti",
|
|
102
|
+
"Trip Map Hand", cursive;
|
|
103
|
+
--inkra-font-body: var(--inkra-font-hand);
|
|
104
|
+
--inkra-font-display: var(--inkra-font-hand);
|
|
105
|
+
--inkra-font-mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
|
|
106
|
+
--inkra-text-xs: 12px;
|
|
107
|
+
--inkra-text-sm: 13px;
|
|
108
|
+
--inkra-text-md: 15px;
|
|
109
|
+
--inkra-text-lg: 17px;
|
|
110
|
+
--inkra-text-xl: 20px;
|
|
111
|
+
--inkra-text-2xl: 24px;
|
|
112
|
+
--inkra-text-3xl: 28px;
|
|
113
|
+
--inkra-weight-regular: 400;
|
|
114
|
+
--inkra-weight-medium: 400;
|
|
115
|
+
--inkra-weight-semibold: 400;
|
|
116
|
+
--inkra-line-tight: 1.2;
|
|
117
|
+
--inkra-line-ui: 1.45;
|
|
118
|
+
--inkra-line-body: 1.6;
|
|
119
|
+
--inkra-letter-spacing: 0;
|
|
120
|
+
|
|
121
|
+
--inkra-space-0: 0;
|
|
122
|
+
--inkra-space-1: 4px;
|
|
123
|
+
--inkra-space-2: 8px;
|
|
124
|
+
--inkra-space-3: 12px;
|
|
125
|
+
--inkra-space-4: 16px;
|
|
126
|
+
--inkra-space-5: 20px;
|
|
127
|
+
--inkra-space-6: 24px;
|
|
128
|
+
--inkra-space-7: 28px;
|
|
129
|
+
--inkra-space-8: 32px;
|
|
130
|
+
--inkra-space-9: 36px;
|
|
131
|
+
--inkra-space-10: 40px;
|
|
132
|
+
--inkra-space-11: 44px;
|
|
133
|
+
--inkra-space-12: 48px;
|
|
134
|
+
--inkra-space-13: 52px;
|
|
135
|
+
--inkra-space-14: 56px;
|
|
136
|
+
--inkra-space-15: 60px;
|
|
137
|
+
--inkra-space-16: 64px;
|
|
138
|
+
--inkra-radius-none: 0;
|
|
139
|
+
--inkra-radius-sm: 3px;
|
|
140
|
+
--inkra-radius-md: 6px;
|
|
141
|
+
--inkra-radius-lg: 8px;
|
|
142
|
+
--inkra-control-xs: 32px;
|
|
143
|
+
--inkra-control-sm: 36px;
|
|
144
|
+
--inkra-control-md: 44px;
|
|
145
|
+
--inkra-control-lg: 48px;
|
|
146
|
+
--inkra-touch-target: 44px;
|
|
147
|
+
--inkra-icon-xs: 14px;
|
|
148
|
+
--inkra-icon-sm: 16px;
|
|
149
|
+
--inkra-icon-md: 20px;
|
|
150
|
+
--inkra-icon-lg: 24px;
|
|
151
|
+
--inkra-content-width: 72rem;
|
|
152
|
+
--inkra-reading-width: 44rem;
|
|
153
|
+
--inkra-sidebar-width: 15rem;
|
|
154
|
+
--inkra-header-height: 64px;
|
|
155
|
+
--inkra-focus-width: 2px;
|
|
156
|
+
--inkra-focus-offset: 3px;
|
|
157
|
+
|
|
158
|
+
--inkra-motion-fast: 120ms;
|
|
159
|
+
--inkra-motion-normal: 180ms;
|
|
160
|
+
--inkra-motion-slow: 420ms;
|
|
161
|
+
--inkra-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
|
|
162
|
+
--inkra-z-base: 0;
|
|
163
|
+
--inkra-z-sticky: 10;
|
|
164
|
+
--inkra-z-popover: 20;
|
|
165
|
+
--inkra-z-modal: 30;
|
|
166
|
+
--inkra-z-tooltip: 40;
|
|
167
|
+
|
|
168
|
+
--inkra-stroke-width: 1.2px;
|
|
169
|
+
--inkra-stroke-variation: 0.82;
|
|
170
|
+
--inkra-stroke-grain: 0.7;
|
|
171
|
+
--inkra-stroke-breaks: 0.2;
|
|
172
|
+
--inkra-stroke-amplitude: 0.6px;
|
|
173
|
+
--inkra-stroke-step: 0.8px;
|
|
174
|
+
--inkra-stroke-passes: 3;
|
|
175
|
+
--inkra-stroke-gain: 2.1;
|
|
176
|
+
--inkra-action-stroke-width: 1.35px;
|
|
177
|
+
--inkra-action-stroke-gain: 2.5;
|
|
178
|
+
--inkra-quiet-stroke-width: 0.75px;
|
|
179
|
+
--inkra-quiet-stroke-passes: 2;
|
|
180
|
+
--inkra-badge-stroke-width: 0.9px;
|
|
181
|
+
--inkra-badge-stroke-passes: 2;
|
|
182
|
+
|
|
183
|
+
--inkra-wash-opacity: 0.48;
|
|
184
|
+
--inkra-wash-strength: 0.48;
|
|
185
|
+
--inkra-wash-spacing: 1.8px;
|
|
186
|
+
--inkra-wash-roughness: 3;
|
|
187
|
+
--inkra-wash-inset: 2px;
|
|
188
|
+
--inkra-wash-edge-reach: 0px;
|
|
189
|
+
--inkra-quiet-wash-strength: 0.18;
|
|
190
|
+
--inkra-badge-wash-strength: 0.25;
|
|
191
|
+
|
|
192
|
+
--inkra-letter-variation: 0.52;
|
|
193
|
+
--inkra-letter-breaks: 0.18;
|
|
194
|
+
--inkra-letter-outline: 0.96;
|
|
195
|
+
--inkra-letter-fill: 0.34;
|
|
196
|
+
--inkra-letter-grain: 0.45;
|
|
197
|
+
--inkra-paper-tile-size: 384px;
|
|
198
|
+
--inkra-render-dpr-cap: 2;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
[data-theme="dark"],
|
|
202
|
+
[data-inkra-theme="dark"] {
|
|
203
|
+
color-scheme: dark;
|
|
204
|
+
|
|
205
|
+
--inkra-paper: #191d1e;
|
|
206
|
+
--inkra-surface: #272d2e;
|
|
207
|
+
--inkra-surface-muted: #23292a;
|
|
208
|
+
--inkra-ink: #f5f6ed;
|
|
209
|
+
--inkra-ink-muted: #becbbb;
|
|
210
|
+
--inkra-ink-subtle: #96a591;
|
|
211
|
+
--inkra-accent: #82bdcb;
|
|
212
|
+
--inkra-accent-strong: #d3e9ee;
|
|
213
|
+
--inkra-accent-soft: #8cb2ba;
|
|
214
|
+
--inkra-on-accent: #edf8fa;
|
|
215
|
+
--inkra-coral: #ffd1c6;
|
|
216
|
+
--inkra-coral-soft: #292920;
|
|
217
|
+
--inkra-blue: #78b8c8;
|
|
218
|
+
--inkra-blue-soft: #78a9b3;
|
|
219
|
+
--inkra-border: #a7b5a6;
|
|
220
|
+
--inkra-border-strong: #a7b5a6;
|
|
221
|
+
--inkra-focus: #a1c9d3;
|
|
222
|
+
--inkra-danger: #ffd1c6;
|
|
223
|
+
--inkra-danger-soft: #d49b8b;
|
|
224
|
+
--inkra-success-pigment: #76a37b;
|
|
225
|
+
--inkra-success-foreground: #d5efd7;
|
|
226
|
+
--inkra-success-surface: #20372b;
|
|
227
|
+
--inkra-warning-surface: #3a3020;
|
|
228
|
+
--inkra-danger-surface: #3b2727;
|
|
229
|
+
--inkra-info-surface: #20343c;
|
|
230
|
+
--inkra-warning-pigment: #d6b67c;
|
|
231
|
+
--inkra-warning-foreground: #ffe5b3;
|
|
232
|
+
--inkra-danger-pigment: #c98f82;
|
|
233
|
+
--inkra-danger-foreground: #ffd1c6;
|
|
234
|
+
--inkra-info-pigment: #82bdcb;
|
|
235
|
+
--inkra-info-foreground: #d8f1f5;
|
|
236
|
+
--inkra-selection: #d6b781;
|
|
237
|
+
--inkra-selection-pigment: #9bbd85;
|
|
238
|
+
--inkra-selection-foreground: #e9f3e3;
|
|
239
|
+
--inkra-overlay: rgb(4 4 3 / 64%);
|
|
240
|
+
--inkra-shadow-overlay: 0 8px 28px rgb(0 0 0 / 28%);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
@media (prefers-color-scheme: dark) {
|
|
244
|
+
:root:not([data-theme]):not([data-inkra-theme]),
|
|
245
|
+
[data-theme="auto"],
|
|
246
|
+
[data-inkra-theme="auto"] {
|
|
247
|
+
color-scheme: dark;
|
|
248
|
+
|
|
249
|
+
--inkra-paper: #191d1e;
|
|
250
|
+
--inkra-surface: #272d2e;
|
|
251
|
+
--inkra-surface-muted: #23292a;
|
|
252
|
+
--inkra-ink: #f5f6ed;
|
|
253
|
+
--inkra-ink-muted: #becbbb;
|
|
254
|
+
--inkra-ink-subtle: #96a591;
|
|
255
|
+
--inkra-accent: #82bdcb;
|
|
256
|
+
--inkra-accent-strong: #d3e9ee;
|
|
257
|
+
--inkra-accent-soft: #8cb2ba;
|
|
258
|
+
--inkra-on-accent: #edf8fa;
|
|
259
|
+
--inkra-coral: #ffd1c6;
|
|
260
|
+
--inkra-coral-soft: #292920;
|
|
261
|
+
--inkra-blue: #78b8c8;
|
|
262
|
+
--inkra-blue-soft: #78a9b3;
|
|
263
|
+
--inkra-border: #a7b5a6;
|
|
264
|
+
--inkra-border-strong: #a7b5a6;
|
|
265
|
+
--inkra-focus: #a1c9d3;
|
|
266
|
+
--inkra-danger: #ffd1c6;
|
|
267
|
+
--inkra-danger-soft: #d49b8b;
|
|
268
|
+
--inkra-success-pigment: #76a37b;
|
|
269
|
+
--inkra-success-foreground: #d5efd7;
|
|
270
|
+
--inkra-success-surface: #20372b;
|
|
271
|
+
--inkra-warning-surface: #3a3020;
|
|
272
|
+
--inkra-danger-surface: #3b2727;
|
|
273
|
+
--inkra-info-surface: #20343c;
|
|
274
|
+
--inkra-warning-pigment: #d6b67c;
|
|
275
|
+
--inkra-warning-foreground: #ffe5b3;
|
|
276
|
+
--inkra-danger-pigment: #c98f82;
|
|
277
|
+
--inkra-danger-foreground: #ffd1c6;
|
|
278
|
+
--inkra-info-pigment: #82bdcb;
|
|
279
|
+
--inkra-info-foreground: #d8f1f5;
|
|
280
|
+
--inkra-selection: #d6b781;
|
|
281
|
+
--inkra-selection-pigment: #9bbd85;
|
|
282
|
+
--inkra-selection-foreground: #e9f3e3;
|
|
283
|
+
--inkra-overlay: rgb(4 4 3 / 64%);
|
|
284
|
+
--inkra-shadow-overlay: 0 8px 28px rgb(0 0 0 / 28%);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
@media (prefers-reduced-motion: reduce) {
|
|
289
|
+
:root,
|
|
290
|
+
[data-theme],
|
|
291
|
+
[data-inkra-theme] {
|
|
292
|
+
--inkra-motion-fast: 0ms;
|
|
293
|
+
--inkra-motion-normal: 0ms;
|
|
294
|
+
--inkra-motion-slow: 0ms;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
@media (prefers-contrast: more) {
|
|
299
|
+
:root,
|
|
300
|
+
[data-theme],
|
|
301
|
+
[data-inkra-theme] {
|
|
302
|
+
--inkra-ink-muted: var(--inkra-ink);
|
|
303
|
+
--inkra-border: var(--inkra-border-strong);
|
|
304
|
+
--inkra-focus-width: 3px;
|
|
305
|
+
--inkra-wash-opacity: 0.18;
|
|
306
|
+
--inkra-wash-strength: 0.18;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
@media (forced-colors: active) {
|
|
311
|
+
:root,
|
|
312
|
+
[data-theme],
|
|
313
|
+
[data-inkra-theme] {
|
|
314
|
+
--inkra-paper: Canvas;
|
|
315
|
+
--inkra-surface: Canvas;
|
|
316
|
+
--inkra-surface-muted: Canvas;
|
|
317
|
+
--inkra-ink: CanvasText;
|
|
318
|
+
--inkra-ink-muted: CanvasText;
|
|
319
|
+
--inkra-ink-subtle: CanvasText;
|
|
320
|
+
--inkra-accent: Highlight;
|
|
321
|
+
--inkra-accent-strong: Highlight;
|
|
322
|
+
--inkra-accent-soft: Canvas;
|
|
323
|
+
--inkra-on-accent: HighlightText;
|
|
324
|
+
--inkra-coral: CanvasText;
|
|
325
|
+
--inkra-coral-soft: Canvas;
|
|
326
|
+
--inkra-blue: LinkText;
|
|
327
|
+
--inkra-blue-soft: Canvas;
|
|
328
|
+
--inkra-border: CanvasText;
|
|
329
|
+
--inkra-border-strong: CanvasText;
|
|
330
|
+
--inkra-focus: Highlight;
|
|
331
|
+
--inkra-danger: Mark;
|
|
332
|
+
--inkra-danger-soft: Canvas;
|
|
333
|
+
--inkra-success-pigment: Highlight;
|
|
334
|
+
--inkra-success-foreground: CanvasText;
|
|
335
|
+
--inkra-warning-pigment: Highlight;
|
|
336
|
+
--inkra-warning-foreground: CanvasText;
|
|
337
|
+
--inkra-danger-pigment: Mark;
|
|
338
|
+
--inkra-danger-foreground: MarkText;
|
|
339
|
+
--inkra-info-pigment: Highlight;
|
|
340
|
+
--inkra-info-foreground: LinkText;
|
|
341
|
+
--inkra-selection: Highlight;
|
|
342
|
+
--inkra-selection-pigment: Highlight;
|
|
343
|
+
--inkra-selection-foreground: HighlightText;
|
|
344
|
+
--inkra-overlay: rgb(0 0 0 / 50%);
|
|
345
|
+
--inkra-shadow-overlay: none;
|
|
346
|
+
--inkra-stroke-grain: 0;
|
|
347
|
+
--inkra-stroke-breaks: 0;
|
|
348
|
+
--inkra-wash-opacity: 0;
|
|
349
|
+
--inkra-wash-strength: 0;
|
|
350
|
+
--inkra-quiet-wash-strength: 0;
|
|
351
|
+
--inkra-badge-wash-strength: 0;
|
|
352
|
+
--inkra-letter-breaks: 0;
|
|
353
|
+
--inkra-letter-grain: 0;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
2
|
+
import type { PencilSurfaceVariant } from '../PencilSurface.js';
|
|
3
|
+
export type TooltipProviderProps = TooltipPrimitive.TooltipProviderProps;
|
|
4
|
+
export declare const TooltipProvider: import("react").FC<TooltipPrimitive.TooltipProviderProps>;
|
|
5
|
+
export type TooltipRootProps = TooltipPrimitive.TooltipProps;
|
|
6
|
+
export declare function TooltipRoot(props: TooltipRootProps): import("react").JSX.Element;
|
|
7
|
+
export type TooltipTriggerProps = TooltipPrimitive.TooltipTriggerProps;
|
|
8
|
+
export declare const TooltipTrigger: import("react").ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
export type TooltipPortalProps = TooltipPrimitive.TooltipPortalProps;
|
|
10
|
+
export declare function TooltipPortal({ children, ...props }: TooltipPortalProps): import("react").JSX.Element;
|
|
11
|
+
export interface TooltipContentProps extends TooltipPrimitive.TooltipContentProps {
|
|
12
|
+
seed?: string | number;
|
|
13
|
+
surfaceClassName?: string;
|
|
14
|
+
surfaceRadius?: number;
|
|
15
|
+
surfaceVariant?: PencilSurfaceVariant;
|
|
16
|
+
}
|
|
17
|
+
export declare const TooltipContent: import("react").ForwardRefExoticComponent<TooltipContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
|
+
export declare const Tooltip: Readonly<{
|
|
19
|
+
Provider: import("react").FC<TooltipPrimitive.TooltipProviderProps>;
|
|
20
|
+
Root: typeof TooltipRoot;
|
|
21
|
+
Trigger: import("react").ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
22
|
+
Portal: typeof TooltipPortal;
|
|
23
|
+
Content: import("react").ForwardRefExoticComponent<TooltipContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
import { forwardRef, useId } from 'react';
|
|
4
|
+
import { PortalThemeBridge, PortalThemeProvider, usePortalTriggerRef } from '../overlay/themeBridge.js';
|
|
5
|
+
import { PencilSurface } from '../PencilSurface.js';
|
|
6
|
+
import { PencilText } from '../PencilText.js';
|
|
7
|
+
function classes(...values) {
|
|
8
|
+
return values.filter(Boolean).join(' ');
|
|
9
|
+
}
|
|
10
|
+
export const TooltipProvider = TooltipPrimitive.Provider;
|
|
11
|
+
export function TooltipRoot(props) {
|
|
12
|
+
return (_jsx(PortalThemeProvider, { children: _jsx(TooltipPrimitive.Root, { ...props }) }));
|
|
13
|
+
}
|
|
14
|
+
export const TooltipTrigger = forwardRef(function TooltipTrigger(props, forwardedRef) {
|
|
15
|
+
const ref = usePortalTriggerRef(forwardedRef);
|
|
16
|
+
return _jsx(TooltipPrimitive.Trigger, { ...props, ref: ref });
|
|
17
|
+
});
|
|
18
|
+
export function TooltipPortal({ children, ...props }) {
|
|
19
|
+
return (_jsx(TooltipPrimitive.Portal, { ...props, children: _jsx(PortalThemeBridge, { children: children }) }));
|
|
20
|
+
}
|
|
21
|
+
export const TooltipContent = forwardRef(function TooltipContent({ children, className, seed, sideOffset = 6, surfaceClassName, surfaceRadius = 6, surfaceVariant = 'paper', ...props }, ref) {
|
|
22
|
+
const generatedId = useId();
|
|
23
|
+
const resolvedSeed = seed ?? `inkra-tooltip-${generatedId}`;
|
|
24
|
+
return (_jsx(TooltipPrimitive.Content, { ...props, className: classes('inkra-tooltip__content', className), ref: ref, sideOffset: sideOffset, children: _jsx(PencilSurface, { className: classes('inkra-tooltip__surface', surfaceClassName), radius: surfaceRadius, seed: resolvedSeed, variant: surfaceVariant, children: _jsx("div", { className: "inkra-tooltip__content-body", children: typeof children === 'string' ? (_jsx(PencilText, { seed: `${resolvedSeed}-text`, children: children })) : children }) }) }));
|
|
25
|
+
});
|
|
26
|
+
export const Tooltip = Object.freeze({
|
|
27
|
+
Provider: TooltipProvider,
|
|
28
|
+
Root: TooltipRoot,
|
|
29
|
+
Trigger: TooltipTrigger,
|
|
30
|
+
Portal: TooltipPortal,
|
|
31
|
+
Content: TooltipContent,
|
|
32
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipRoot, TooltipTrigger, } from './Tooltip.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,102 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inkra/react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Hand-drawn React controls with native semantics and deterministic decoration.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/inkrajs/inkra.git",
|
|
10
|
+
"directory": "packages/inkra"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://inkrajs.github.io/",
|
|
13
|
+
"bugs": { "url": "https://github.com/inkrajs/inkra/issues" },
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./PencilSurface": {
|
|
23
|
+
"types": "./dist/PencilSurface.d.ts",
|
|
24
|
+
"import": "./dist/PencilSurface.js",
|
|
25
|
+
"default": "./dist/PencilSurface.js"
|
|
26
|
+
},
|
|
27
|
+
"./PencilText": {
|
|
28
|
+
"types": "./dist/PencilText.d.ts",
|
|
29
|
+
"import": "./dist/PencilText.js",
|
|
30
|
+
"default": "./dist/PencilText.js"
|
|
31
|
+
},
|
|
32
|
+
"./PencilIcon": {
|
|
33
|
+
"types": "./dist/PencilIcon.d.ts",
|
|
34
|
+
"import": "./dist/PencilIcon.js",
|
|
35
|
+
"default": "./dist/PencilIcon.js"
|
|
36
|
+
},
|
|
37
|
+
"./PencilLine": {
|
|
38
|
+
"types": "./dist/PencilLine.d.ts",
|
|
39
|
+
"import": "./dist/PencilLine.js",
|
|
40
|
+
"default": "./dist/PencilLine.js"
|
|
41
|
+
},
|
|
42
|
+
"./styles.css": "./dist/styles.css",
|
|
43
|
+
"./tokens.css": "./dist/tokens.css",
|
|
44
|
+
"./package.json": "./package.json"
|
|
45
|
+
},
|
|
46
|
+
"files": [
|
|
47
|
+
"dist",
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE",
|
|
50
|
+
"THIRD_PARTY_NOTICES.md",
|
|
51
|
+
"Yozai-OFL.txt"
|
|
52
|
+
],
|
|
53
|
+
"sideEffects": [
|
|
54
|
+
"**/*.css"
|
|
55
|
+
],
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "node scripts/clean.mjs && tsc -p tsconfig.json && node scripts/copy-styles.mjs",
|
|
58
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
59
|
+
"test": "npm run build && node --test test/*.test.mjs",
|
|
60
|
+
"pack:check": "npm pack --dry-run"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"react": ">=18",
|
|
64
|
+
"react-dom": ">=18"
|
|
65
|
+
},
|
|
66
|
+
"devDependencies": {
|
|
67
|
+
"@types/leaflet": "^1.9.22",
|
|
68
|
+
"@types/react": "19.3.0",
|
|
69
|
+
"@types/react-dom": "19.3.0",
|
|
70
|
+
"react": "19.3.1",
|
|
71
|
+
"react-dom": "19.3.1",
|
|
72
|
+
"typescript": "5.9.3"
|
|
73
|
+
},
|
|
74
|
+
"publishConfig": {
|
|
75
|
+
"registry": "https://registry.npmjs.org/",
|
|
76
|
+
"access": "public",
|
|
77
|
+
"tag": "latest"
|
|
78
|
+
},
|
|
79
|
+
"keywords": [
|
|
80
|
+
"react",
|
|
81
|
+
"components",
|
|
82
|
+
"hand-drawn",
|
|
83
|
+
"pencil",
|
|
84
|
+
"accessible"
|
|
85
|
+
],
|
|
86
|
+
"dependencies": {
|
|
87
|
+
"@base-ui/react": "^1.9.0",
|
|
88
|
+
"@radix-ui/react-accordion": "^1.3.1",
|
|
89
|
+
"@radix-ui/react-avatar": "^1.3.1",
|
|
90
|
+
"@radix-ui/react-dialog": "^1.3.1",
|
|
91
|
+
"@radix-ui/react-dropdown-menu": "^2.2.1",
|
|
92
|
+
"@radix-ui/react-popover": "^1.3.1",
|
|
93
|
+
"@radix-ui/react-select": "^2.4.1",
|
|
94
|
+
"@radix-ui/react-slider": "^1.6.1",
|
|
95
|
+
"@radix-ui/react-tabs": "^1.2.1",
|
|
96
|
+
"@radix-ui/react-tooltip": "^1.4.1",
|
|
97
|
+
"@types/geojson": "^7946.0.16",
|
|
98
|
+
"leaflet": "^1.9.4",
|
|
99
|
+
"lucide-react": "^1.60.0",
|
|
100
|
+
"react-day-picker": "^9.14.0"
|
|
101
|
+
}
|
|
102
|
+
}
|