@_linked/primitives 1.1.0 → 1.2.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.
Files changed (74) hide show
  1. package/.gitattributes +1 -0
  2. package/.github/workflows/pr.yml +18 -0
  3. package/.github/workflows/publish.yml +16 -63
  4. package/CHANGELOG.md +61 -0
  5. package/README.md +62 -0
  6. package/lib/cjs/components/ConfirmDialog.d.ts +37 -0
  7. package/lib/cjs/components/ConfirmDialog.js +68 -0
  8. package/lib/cjs/components/ConfirmDialog.js.map +1 -0
  9. package/lib/cjs/components/ConfirmDialog.module.css +22 -0
  10. package/lib/cjs/components/ImageThumb.d.ts +17 -0
  11. package/lib/cjs/components/ImageThumb.js +90 -0
  12. package/lib/cjs/components/ImageThumb.js.map +1 -0
  13. package/lib/cjs/components/ImageThumb.module.css +134 -0
  14. package/lib/cjs/components/SkeletonLoader.d.ts +14 -0
  15. package/lib/cjs/components/SkeletonLoader.js +71 -0
  16. package/lib/cjs/components/SkeletonLoader.js.map +1 -0
  17. package/lib/cjs/components/SkeletonLoader.module.css +83 -0
  18. package/lib/cjs/components/Spinner.d.ts +22 -3
  19. package/lib/cjs/components/Spinner.js +55 -3
  20. package/lib/cjs/components/Spinner.js.map +1 -1
  21. package/lib/cjs/components/Spinner.module.css +57 -10
  22. package/lib/cjs/components/TruncatedText.d.ts +16 -0
  23. package/lib/cjs/components/TruncatedText.js +130 -0
  24. package/lib/cjs/components/TruncatedText.js.map +1 -0
  25. package/lib/cjs/components/TruncatedText.module.css +162 -0
  26. package/lib/cjs/hooks/useReducedMotion.d.ts +12 -0
  27. package/lib/cjs/hooks/useReducedMotion.js +35 -0
  28. package/lib/cjs/hooks/useReducedMotion.js.map +1 -0
  29. package/lib/cjs/index.d.ts +5 -0
  30. package/lib/cjs/index.js +21 -0
  31. package/lib/cjs/index.js.map +1 -1
  32. package/lib/cjs/motion.d.ts +219 -0
  33. package/lib/cjs/motion.js +154 -0
  34. package/lib/cjs/motion.js.map +1 -0
  35. package/lib/cjs/ontologies/primitives.d.ts +10 -1
  36. package/lib/cjs/ontologies/primitives.js +1 -1
  37. package/lib/cjs/ontologies/primitives.js.map +1 -1
  38. package/lib/cjs/package.json +12 -11
  39. package/lib/esm/components/ConfirmDialog.d.ts +37 -0
  40. package/lib/esm/components/ConfirmDialog.js +29 -0
  41. package/lib/esm/components/ConfirmDialog.js.map +1 -0
  42. package/lib/esm/components/ConfirmDialog.module.css +22 -0
  43. package/lib/esm/components/ImageThumb.d.ts +17 -0
  44. package/lib/esm/components/ImageThumb.js +50 -0
  45. package/lib/esm/components/ImageThumb.js.map +1 -0
  46. package/lib/esm/components/ImageThumb.module.css +134 -0
  47. package/lib/esm/components/SkeletonLoader.d.ts +14 -0
  48. package/lib/esm/components/SkeletonLoader.js +31 -0
  49. package/lib/esm/components/SkeletonLoader.js.map +1 -0
  50. package/lib/esm/components/SkeletonLoader.module.css +83 -0
  51. package/lib/esm/components/Spinner.d.ts +22 -3
  52. package/lib/esm/components/Spinner.js +22 -3
  53. package/lib/esm/components/Spinner.js.map +1 -1
  54. package/lib/esm/components/Spinner.module.css +57 -10
  55. package/lib/esm/components/TruncatedText.d.ts +16 -0
  56. package/lib/esm/components/TruncatedText.js +83 -0
  57. package/lib/esm/components/TruncatedText.js.map +1 -0
  58. package/lib/esm/components/TruncatedText.module.css +162 -0
  59. package/lib/esm/hooks/useReducedMotion.d.ts +12 -0
  60. package/lib/esm/hooks/useReducedMotion.js +32 -0
  61. package/lib/esm/hooks/useReducedMotion.js.map +1 -0
  62. package/lib/esm/index.d.ts +5 -0
  63. package/lib/esm/index.js +7 -0
  64. package/lib/esm/index.js.map +1 -1
  65. package/lib/esm/motion.d.ts +219 -0
  66. package/lib/esm/motion.js +154 -0
  67. package/lib/esm/motion.js.map +1 -0
  68. package/lib/esm/ontologies/primitives.d.ts +10 -1
  69. package/lib/esm/ontologies/primitives.js +3 -1
  70. package/lib/esm/ontologies/primitives.js.map +1 -1
  71. package/lib/esm/package.json +12 -11
  72. package/package.json +12 -11
  73. package/.github/workflows/changeset-check.yml +0 -44
  74. package/.github/workflows/ci.yml +0 -43
@@ -0,0 +1,162 @@
1
+ @import './helpers/mixins.css';
2
+ @import '@_linked/css/package.css';
3
+
4
+ /* ============================================================================
5
+ TruncatedText.module.css
6
+
7
+ Truncated text component with hover popover for full content.
8
+ Uses semantic tokens from theme.css.
9
+ ============================================================================ */
10
+
11
+ /* === Truncated Text Trigger === */
12
+ .truncatedText {
13
+ cursor: help;
14
+ border-bottom: 1px dotted var(--truncated-text-gray-400, var(--color-gray-400));
15
+ }
16
+
17
+ /* === Hover Card Content === */
18
+ .hoverContent {
19
+ background-color: var(--surface-bg);
20
+ border: 1px solid var(--surface-border);
21
+ border-radius: var(--radius-field);
22
+ box-shadow: var(--surface-shadow);
23
+ padding: var(--space-sm);
24
+ max-width: 400px;
25
+ min-width: 200px;
26
+ z-index: 1000;
27
+ }
28
+
29
+ /* === Content Wrapper === */
30
+ .contentWrapper {
31
+ display: flex;
32
+ flex-direction: column;
33
+ gap: var(--space-xs);
34
+ }
35
+
36
+ /* === Scroll Area === */
37
+ .scrollArea {
38
+ max-height: 150px;
39
+ overflow-y: auto;
40
+ }
41
+
42
+ /* === Full Text === */
43
+ .fullText {
44
+ font-size: var(--typography-small-size);
45
+ color: var(--text-primary);
46
+ line-height: 1.5;
47
+ margin: 0;
48
+ white-space: pre-wrap;
49
+ word-break: break-word;
50
+ }
51
+
52
+ /* === Copy Button Wrapper === */
53
+ .copyButtonWrapper {
54
+ display: flex;
55
+ justify-content: flex-end;
56
+ border-top: 1px solid var(--surface-border);
57
+ padding-top: var(--space-xs);
58
+ margin-top: var(--space-xs);
59
+ }
60
+
61
+ /* === Copy Button === */
62
+ .copyButton {
63
+ color: var(--truncated-text-tertiary-500, var(--color-tertiary-500)) !important;
64
+ padding: var(--space-xs) !important;
65
+ }
66
+
67
+ .copyButton:hover {
68
+ color: var(--truncated-text-tertiary-600, var(--color-tertiary-600)) !important;
69
+ background-color: color-mix(
70
+ in srgb,
71
+ var(--truncated-text-tertiary-500, var(--color-tertiary-500)) 12%,
72
+ transparent
73
+ ) !important;
74
+ }
75
+
76
+ /* === Arrow === */
77
+ .arrow {
78
+ fill: var(--surface-bg);
79
+ }
80
+
81
+ /* ============================================================================
82
+ Mobile Dialog Styles
83
+ ============================================================================ */
84
+
85
+ .dialogContent {
86
+ max-width: 90vw;
87
+ width: 400px;
88
+ background-color: var(--surface-bg);
89
+ border: 1px solid var(--surface-border);
90
+ }
91
+
92
+ .dialogBody {
93
+ padding: var(--space-sm) 0;
94
+ color: var(--text-primary);
95
+ }
96
+
97
+ .dialogFooter {
98
+ display: flex;
99
+ justify-content: flex-end;
100
+ align-items: center;
101
+ padding-top: var(--space-xs);
102
+ border-top: 1px solid var(--surface-border);
103
+ }
104
+
105
+ /* ============================================================================
106
+ Dark Mode
107
+ ============================================================================ */
108
+
109
+ [data-theme='dark'] .truncatedText {
110
+ border-bottom-color: var(--truncated-text-gray-500, var(--color-gray-500));
111
+ }
112
+
113
+ [data-theme='dark'] .hoverContent {
114
+ background-color: var(--surface-bg);
115
+ border-color: var(--surface-border);
116
+ }
117
+
118
+ /* .fullText uses --text-primary which auto-adjusts for dark mode */
119
+
120
+ [data-theme='dark'] .copyButtonWrapper {
121
+ border-top-color: var(--surface-border);
122
+ }
123
+
124
+ [data-theme='dark'] .copyButton {
125
+ color: var(--truncated-text-tertiary-400, var(--color-tertiary-400)) !important;
126
+ }
127
+
128
+ [data-theme='dark'] .copyButton:hover {
129
+ color: var(--truncated-text-tertiary-300, var(--color-tertiary-300)) !important;
130
+ background-color: color-mix(
131
+ in srgb,
132
+ var(--truncated-text-tertiary-500, var(--color-tertiary-500)) 15%,
133
+ transparent
134
+ ) !important;
135
+ }
136
+
137
+ [data-theme='dark'] .arrow {
138
+ fill: var(--surface-bg);
139
+ }
140
+
141
+ [data-theme='dark'] .dialogContent {
142
+ background-color: var(--surface-bg);
143
+ border-color: var(--surface-border);
144
+ }
145
+
146
+ /* .dialogBody uses --text-primary which auto-adjusts for dark mode */
147
+
148
+ [data-theme='dark'] .dialogFooter {
149
+ border-top-color: var(--surface-border);
150
+ }
151
+
152
+ /* Dialog close button in dark mode */
153
+ [data-theme='dark'] .dialogContent button[aria-label="Close"],
154
+ [data-theme='dark'] .dialogContent [class*="Close"] {
155
+ color: var(--truncated-text-gray-400, var(--color-gray-400));
156
+ }
157
+
158
+ [data-theme='dark'] .dialogContent button[aria-label="Close"]:hover,
159
+ [data-theme='dark'] .dialogContent [class*="Close"]:hover {
160
+ color: var(--truncated-text-gray-200, var(--color-gray-200));
161
+ background-color: var(--truncated-text-gray-700, var(--color-gray-700));
162
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Whether the viewer has asked for reduced motion.
3
+ *
4
+ * Plain `matchMedia`, deliberately: this is the one piece of the motion story that every
5
+ * component needs and that carries no dependency, so it lives here rather than travelling
6
+ * with an animation library.
7
+ *
8
+ * Starts `false` and corrects on mount. Server-rendered markup cannot know the preference,
9
+ * and rendering the still version first would flash into motion for everyone else; erring
10
+ * toward motion and stopping it is the less disruptive order.
11
+ */
12
+ export declare function useReducedMotion(): boolean;
@@ -0,0 +1,32 @@
1
+ import { useEffect, useState } from 'react';
2
+ /**
3
+ * Whether the viewer has asked for reduced motion.
4
+ *
5
+ * Plain `matchMedia`, deliberately: this is the one piece of the motion story that every
6
+ * component needs and that carries no dependency, so it lives here rather than travelling
7
+ * with an animation library.
8
+ *
9
+ * Starts `false` and corrects on mount. Server-rendered markup cannot know the preference,
10
+ * and rendering the still version first would flash into motion for everyone else; erring
11
+ * toward motion and stopping it is the less disruptive order.
12
+ */
13
+ export function useReducedMotion() {
14
+ const [reduced, setReduced] = useState(false);
15
+ useEffect(() => {
16
+ if (typeof window === 'undefined' || !window.matchMedia)
17
+ return;
18
+ const query = window.matchMedia('(prefers-reduced-motion: reduce)');
19
+ setReduced(query.matches);
20
+ const onChange = (event) => setReduced(event.matches);
21
+ // `addEventListener` on MediaQueryList is not in older Safari; both are kept because a
22
+ // component library cannot choose its host browser.
23
+ if (query.addEventListener) {
24
+ query.addEventListener('change', onChange);
25
+ return () => query.removeEventListener('change', onChange);
26
+ }
27
+ query.addListener(onChange);
28
+ return () => query.removeListener(onChange);
29
+ }, []);
30
+ return reduced;
31
+ }
32
+ //# sourceMappingURL=useReducedMotion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useReducedMotion.js","sourceRoot":"","sources":["../../../src/hooks/useReducedMotion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,OAAO,CAAC;AAE1C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,UAAU;YAAE,OAAO;QAChE,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC;QACpE,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC1B,MAAM,QAAQ,GAAG,CAAC,KAA0B,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC3E,uFAAuF;QACvF,oDAAoD;QACpD,IAAI,KAAK,CAAC,gBAAgB,EAAE,CAAC;YAC3B,KAAK,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;YAC3C,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC7D,CAAC;QACD,KAAK,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;QAC5B,OAAO,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;IAC9C,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -35,6 +35,10 @@ import './components/NavigationMenu.js';
35
35
  import './components/Menubar.js';
36
36
  import './components/MultiSelect.js';
37
37
  import './components/Spinner.js';
38
+ import './components/ConfirmDialog.js';
39
+ import './components/SkeletonLoader.js';
40
+ import './components/ImageThumb.js';
41
+ import './components/TruncatedText.js';
38
42
  import './components/Breadcrumb.js';
39
43
  import './components/Drawer.js';
40
44
  import './components/IconButton.js';
@@ -44,3 +48,4 @@ import './components/Form.js';
44
48
  import './components/Toolbar.js';
45
49
  import './components/VisuallyHidden.js';
46
50
  import './hooks/use-toast.js';
51
+ export * from './motion.js';
package/lib/esm/index.js CHANGED
@@ -38,6 +38,10 @@ import './components/NavigationMenu.js';
38
38
  import './components/Menubar.js';
39
39
  import './components/MultiSelect.js';
40
40
  import './components/Spinner.js';
41
+ import './components/ConfirmDialog.js';
42
+ import './components/SkeletonLoader.js';
43
+ import './components/ImageThumb.js';
44
+ import './components/TruncatedText.js';
41
45
  import './components/Breadcrumb.js';
42
46
  import './components/Drawer.js';
43
47
  import './components/IconButton.js';
@@ -47,4 +51,7 @@ import './components/Form.js';
47
51
  import './components/Toolbar.js';
48
52
  import './components/VisuallyHidden.js';
49
53
  import './hooks/use-toast.js';
54
+ // The motion presets. Reachable from the entry point so tsc emits them: this package's
55
+ // tsconfig compiles what `index.ts` reaches, not the whole src tree.
56
+ export * from './motion.js';
50
57
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAC;AACrB,OAAO,YAAY,CAAC;AACpB,OAAO,4BAA4B,CAAC;AAEpC,cAAc;AACd,kCAAkC;AAElC,iBAAiB;AACjB,OAAO,uBAAuB,CAAC;AAC/B,OAAO,wBAAwB,CAAC;AAChC,OAAO,uBAAuB,CAAC;AAC/B,OAA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ExC,OAAO,sBAAsB,CAAC;AAE9B,uFAAuF;AACvF,qEAAqE;AACrE,cAAc,aAAa,CAAC"}
@@ -0,0 +1,219 @@
1
+ /**
2
+ * Motion presets.
3
+ *
4
+ * Design tokens that happen to be objects rather than CSS custom properties, because that is
5
+ * the shape an animation library consumes. Same purpose as a colour token: one definition of
6
+ * "how a list staggers in", so two surfaces cannot disagree about it.
7
+ *
8
+ * This module imports **nothing**, not even types. Every export is a plain object whose type
9
+ * is inferred, and an inferred object literal is structurally assignable to `framer-motion`'s
10
+ * `Variants` and `Transition` at the point of use — so a consumer gets full checking without
11
+ * this package depending on the animation library at all.
12
+ *
13
+ * That matters more than it looks. Naming the types here would mean a devDependency to build
14
+ * and a peer to consume, which is how the workspace ended up with two copies of
15
+ * `framer-motion` and presets from one that were not assignable to the other. A library that
16
+ * animates with CSS should not carry an animation library so it can describe some constants.
17
+ */
18
+ import { useReducedMotion } from './hooks/useReducedMotion.js';
19
+ /**
20
+ * Shared animation variants for consistent motion across the app
21
+ */
22
+ export declare const fadeInUp: {
23
+ initial: {
24
+ opacity: number;
25
+ y: number;
26
+ };
27
+ animate: {
28
+ opacity: number;
29
+ y: number;
30
+ };
31
+ exit: {
32
+ opacity: number;
33
+ y: number;
34
+ };
35
+ };
36
+ export declare const fadeIn: {
37
+ initial: {
38
+ opacity: number;
39
+ };
40
+ animate: {
41
+ opacity: number;
42
+ };
43
+ exit: {
44
+ opacity: number;
45
+ };
46
+ };
47
+ export declare const scaleIn: {
48
+ initial: {
49
+ opacity: number;
50
+ scale: number;
51
+ };
52
+ animate: {
53
+ opacity: number;
54
+ scale: number;
55
+ };
56
+ exit: {
57
+ opacity: number;
58
+ scale: number;
59
+ };
60
+ };
61
+ export declare const slideInRight: {
62
+ initial: {
63
+ x: number;
64
+ opacity: number;
65
+ };
66
+ animate: {
67
+ x: number;
68
+ opacity: number;
69
+ };
70
+ exit: {
71
+ x: number;
72
+ opacity: number;
73
+ };
74
+ };
75
+ /**
76
+ * Easing and transition configurations
77
+ */
78
+ /**
79
+ * A cubic-bezier easing: the four control points, as a tuple.
80
+ *
81
+ * The tuple type is load-bearing. Written inline, `[0.16, 1, 0.3, 1]` infers as `number[]`,
82
+ * which is not assignable to an animation library's easing type — it wants exactly four
83
+ * numbers. Naming it once fixes that and stops the curve being retyped at each use.
84
+ */
85
+ export type Easing = [number, number, number, number];
86
+ /** The shared ease-out curve. Decelerates hard at the end, so motion settles rather than stops. */
87
+ export declare const EASE_OUT_CURVE: Easing;
88
+ export declare const spring: {
89
+ type: string;
90
+ stiffness: number;
91
+ damping: number;
92
+ };
93
+ export declare const easeOut: {
94
+ duration: number;
95
+ ease: Easing;
96
+ };
97
+ export declare const easeSlow: {
98
+ duration: number;
99
+ ease: Easing;
100
+ };
101
+ /**
102
+ * Stagger animation configurations
103
+ */
104
+ export declare const staggerContainer: {
105
+ animate: {
106
+ transition: {
107
+ staggerChildren: number;
108
+ };
109
+ };
110
+ };
111
+ export declare const staggerItem: {
112
+ initial: {
113
+ opacity: number;
114
+ y: number;
115
+ };
116
+ animate: {
117
+ opacity: number;
118
+ y: number;
119
+ };
120
+ };
121
+ /**
122
+ * Slower stagger for table rows - more subtle and elegant
123
+ */
124
+ export declare const tableStaggerContainer: {
125
+ animate: {
126
+ transition: {
127
+ staggerChildren: number;
128
+ delayChildren: number;
129
+ };
130
+ };
131
+ };
132
+ export declare const tableRowItem: {
133
+ initial: {
134
+ opacity: number;
135
+ y: number;
136
+ };
137
+ animate: {
138
+ opacity: number;
139
+ y: number;
140
+ transition: {
141
+ duration: number;
142
+ ease: Easing;
143
+ };
144
+ };
145
+ };
146
+ /**
147
+ * Stagger for card grids - elegant cascade effect
148
+ */
149
+ export declare const cardGridContainer: {
150
+ hidden: {
151
+ opacity: number;
152
+ };
153
+ visible: {
154
+ opacity: number;
155
+ transition: {
156
+ staggerChildren: number;
157
+ delayChildren: number;
158
+ };
159
+ };
160
+ };
161
+ export declare const cardGridItem: {
162
+ hidden: {
163
+ opacity: number;
164
+ y: number;
165
+ scale: number;
166
+ };
167
+ visible: {
168
+ opacity: number;
169
+ y: number;
170
+ scale: number;
171
+ transition: {
172
+ duration: number;
173
+ ease: Easing;
174
+ };
175
+ };
176
+ };
177
+ /**
178
+ * Stagger for list items - subtle slide-in effect
179
+ */
180
+ export declare const listContainer: {
181
+ hidden: {
182
+ opacity: number;
183
+ };
184
+ visible: {
185
+ opacity: number;
186
+ transition: {
187
+ staggerChildren: number;
188
+ delayChildren: number;
189
+ };
190
+ };
191
+ };
192
+ export declare const listItem: {
193
+ hidden: {
194
+ opacity: number;
195
+ x: number;
196
+ };
197
+ visible: {
198
+ opacity: number;
199
+ x: number;
200
+ transition: {
201
+ duration: number;
202
+ ease: Easing;
203
+ };
204
+ };
205
+ };
206
+ /**
207
+ * Re-exported so a component reaching for the motion presets does not have to know that the
208
+ * preference hook lives elsewhere. It carries no animation dependency of its own.
209
+ */
210
+ export { useReducedMotion };
211
+ /**
212
+ * Get appropriate transition based on reduced motion preference
213
+ */
214
+ export declare const getTransition: (reducedMotion: boolean) => {
215
+ duration: number;
216
+ ease: Easing;
217
+ } | {
218
+ duration: number;
219
+ };
@@ -0,0 +1,154 @@
1
+ /**
2
+ * Motion presets.
3
+ *
4
+ * Design tokens that happen to be objects rather than CSS custom properties, because that is
5
+ * the shape an animation library consumes. Same purpose as a colour token: one definition of
6
+ * "how a list staggers in", so two surfaces cannot disagree about it.
7
+ *
8
+ * This module imports **nothing**, not even types. Every export is a plain object whose type
9
+ * is inferred, and an inferred object literal is structurally assignable to `framer-motion`'s
10
+ * `Variants` and `Transition` at the point of use — so a consumer gets full checking without
11
+ * this package depending on the animation library at all.
12
+ *
13
+ * That matters more than it looks. Naming the types here would mean a devDependency to build
14
+ * and a peer to consume, which is how the workspace ended up with two copies of
15
+ * `framer-motion` and presets from one that were not assignable to the other. A library that
16
+ * animates with CSS should not carry an animation library so it can describe some constants.
17
+ */
18
+ import { useReducedMotion } from './hooks/useReducedMotion.js';
19
+ /**
20
+ * Shared animation variants for consistent motion across the app
21
+ */
22
+ // Fade animations
23
+ export const fadeInUp = {
24
+ initial: { opacity: 0, y: 20 },
25
+ animate: { opacity: 1, y: 0 },
26
+ exit: { opacity: 0, y: -20 },
27
+ };
28
+ export const fadeIn = {
29
+ initial: { opacity: 0 },
30
+ animate: { opacity: 1 },
31
+ exit: { opacity: 0 },
32
+ };
33
+ export const scaleIn = {
34
+ initial: { opacity: 0, scale: 0.95 },
35
+ animate: { opacity: 1, scale: 1 },
36
+ exit: { opacity: 0, scale: 0.95 },
37
+ };
38
+ export const slideInRight = {
39
+ initial: { x: -20, opacity: 0 },
40
+ animate: { x: 0, opacity: 1 },
41
+ exit: { x: -20, opacity: 0 },
42
+ };
43
+ /** The shared ease-out curve. Decelerates hard at the end, so motion settles rather than stops. */
44
+ export const EASE_OUT_CURVE = [0.16, 1, 0.3, 1];
45
+ export const spring = {
46
+ type: 'spring',
47
+ stiffness: 300,
48
+ damping: 30,
49
+ };
50
+ export const easeOut = {
51
+ duration: 0.2,
52
+ ease: EASE_OUT_CURVE,
53
+ };
54
+ export const easeSlow = {
55
+ duration: 0.3,
56
+ ease: EASE_OUT_CURVE,
57
+ };
58
+ /**
59
+ * Stagger animation configurations
60
+ */
61
+ export const staggerContainer = {
62
+ animate: {
63
+ transition: {
64
+ staggerChildren: 0.05,
65
+ },
66
+ },
67
+ };
68
+ export const staggerItem = {
69
+ initial: { opacity: 0, y: 10 },
70
+ animate: { opacity: 1, y: 0 },
71
+ };
72
+ /**
73
+ * Slower stagger for table rows - more subtle and elegant
74
+ */
75
+ export const tableStaggerContainer = {
76
+ animate: {
77
+ transition: {
78
+ staggerChildren: 0.08,
79
+ delayChildren: 0.1,
80
+ },
81
+ },
82
+ };
83
+ export const tableRowItem = {
84
+ initial: { opacity: 0, y: 8 },
85
+ animate: {
86
+ opacity: 1,
87
+ y: 0,
88
+ transition: {
89
+ duration: 0.35,
90
+ ease: EASE_OUT_CURVE,
91
+ },
92
+ },
93
+ };
94
+ /**
95
+ * Stagger for card grids - elegant cascade effect
96
+ */
97
+ export const cardGridContainer = {
98
+ hidden: { opacity: 0 },
99
+ visible: {
100
+ opacity: 1,
101
+ transition: {
102
+ staggerChildren: 0.04,
103
+ delayChildren: 0.05,
104
+ },
105
+ },
106
+ };
107
+ export const cardGridItem = {
108
+ hidden: { opacity: 0, y: 12, scale: 0.98 },
109
+ visible: {
110
+ opacity: 1,
111
+ y: 0,
112
+ scale: 1,
113
+ transition: {
114
+ duration: 0.3,
115
+ ease: EASE_OUT_CURVE,
116
+ },
117
+ },
118
+ };
119
+ /**
120
+ * Stagger for list items - subtle slide-in effect
121
+ */
122
+ export const listContainer = {
123
+ hidden: { opacity: 0 },
124
+ visible: {
125
+ opacity: 1,
126
+ transition: {
127
+ staggerChildren: 0.03,
128
+ delayChildren: 0.02,
129
+ },
130
+ },
131
+ };
132
+ export const listItem = {
133
+ hidden: { opacity: 0, x: -8 },
134
+ visible: {
135
+ opacity: 1,
136
+ x: 0,
137
+ transition: {
138
+ duration: 0.25,
139
+ ease: EASE_OUT_CURVE,
140
+ },
141
+ },
142
+ };
143
+ /**
144
+ * Re-exported so a component reaching for the motion presets does not have to know that the
145
+ * preference hook lives elsewhere. It carries no animation dependency of its own.
146
+ */
147
+ export { useReducedMotion };
148
+ /**
149
+ * Get appropriate transition based on reduced motion preference
150
+ */
151
+ export const getTransition = (reducedMotion) => {
152
+ return reducedMotion ? { duration: 0 } : easeOut;
153
+ };
154
+ //# sourceMappingURL=motion.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"motion.js","sourceRoot":"","sources":["../../src/motion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAC,gBAAgB,EAAC,MAAM,6BAA6B,CAAC;AAE7D;;GAEG;AAEH,kBAAkB;AAClB,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,E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OAAO,EAAE,CAAC;QACV,CAAC,EAAE,CAAC;QACJ,KAAK,EAAE,CAAC;QACR,UAAU,EAAE;YACV,QAAQ,EAAE,GAAG;YACb,IAAI,EAAE,cAAc;SACrB;KACF;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;IACtB,OAAO,EAAE;QACP,OAAO,EAAE,CAAC;QACV,UAAU,EAAE;YACV,eAAe,EAAE,IAAI;YACrB,aAAa,EAAE,IAAI;SACpB;KACF;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE;IAC7B,OAAO,EAAE;QACP,OAAO,EAAE,CAAC;QACV,CAAC,EAAE,CAAC;QACJ,UAAU,EAAE;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,cAAc;SACrB;KACF;CACF,CAAC;AAEF;;;GAGG;AACH,OAAO,EAAC,gBAAgB,EAAC,CAAC;AAE1B;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,aAAsB,EAAE,EAAE;IACtD,OAAO,aAAa,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;AACnD,CAAC,CAAC"}
@@ -1,4 +1,13 @@
1
- export declare const loadData: () => Promise<any>;
1
+ export declare const loadData: () => Promise<{
2
+ "@context": {
3
+ dc: string;
4
+ owl: string;
5
+ rdf: string;
6
+ rdfs: string;
7
+ primitives: string;
8
+ };
9
+ "@graph": any[];
10
+ }>;
2
11
  export declare const ns: (term: string) => import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
3
12
  export declare const _self: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
4
13
  export declare const radix: {
@@ -7,7 +7,9 @@ const base = 'http://lincd.org/ont/radix/';
7
7
  Prefix.add('radix', base);
8
8
  export const loadData = () => {
9
9
  //@ts-ignore
10
- return import(dataFile, { with: { type: 'json' } }).then((data) => data.default);
10
+ return import('../data/primitives.json', {
11
+ with: { type: 'json' },
12
+ }).then((data) => data.default);
11
13
  };
12
14
  export const ns = createNameSpace(base);
13
15
  export const _self = ns('');
@@ -1 +1 @@
1
- {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../src/ontologies/primitives.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,KAAK,MAAM,iBAAiB,CAAC;AAEzC,MAAM,QAAQ,GAAG,yBAAyB,CAAC;AAC3C,MAAM,IAAI,GAAG,6BAA6B,CAAC;AAE3C,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAE1B,MAAM,CAAC,MAAM,QAAQ,GAAG,GAAG,EAAE;IAC3B,YAAY;IACZ,OAAO,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,IAAI,CACtD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,EAAE,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;AACxC,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AAE5B,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,KAAK;CACN,CAAC;AAEF,cAAc,CAAC,KAAK,EAAE,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC"}
1
+ {"version":3,"file":"primitives.js","sourceRoot":"","sources":["../../../src/ontologies/primitives.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