@korzun/design 0.0.6 → 0.2.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.
Files changed (89) hide show
  1. package/AGENTS.md +11 -4
  2. package/dist/component/heading/index.d.ts +303 -0
  3. package/dist/component/heading/index.d.ts.map +1 -0
  4. package/dist/component/heading/index.js +21 -0
  5. package/dist/component/heading/index.js.map +1 -0
  6. package/dist/component/heading/style.d.ts +5 -0
  7. package/dist/component/heading/style.d.ts.map +1 -0
  8. package/dist/component/heading/style.js +5 -0
  9. package/dist/component/heading/style.js.map +1 -0
  10. package/dist/component/index.d.ts +4 -0
  11. package/dist/component/index.d.ts.map +1 -1
  12. package/dist/component/index.js +4 -0
  13. package/dist/component/index.js.map +1 -1
  14. package/dist/component/inline/index.d.ts +303 -0
  15. package/dist/component/inline/index.d.ts.map +1 -0
  16. package/dist/component/inline/index.js +13 -0
  17. package/dist/component/inline/index.js.map +1 -0
  18. package/dist/component/inline/style.d.ts +5 -0
  19. package/dist/component/inline/style.d.ts.map +1 -0
  20. package/dist/component/inline/style.js +18 -0
  21. package/dist/component/inline/style.js.map +1 -0
  22. package/dist/component/stack/gap.d.ts +4 -0
  23. package/dist/component/stack/gap.d.ts.map +1 -0
  24. package/dist/component/stack/gap.js +10 -0
  25. package/dist/component/stack/gap.js.map +1 -0
  26. package/dist/component/stack/index.d.ts +299 -0
  27. package/dist/component/stack/index.d.ts.map +1 -0
  28. package/dist/component/stack/index.js +13 -0
  29. package/dist/component/stack/index.js.map +1 -0
  30. package/dist/component/stack/style.d.ts +5 -0
  31. package/dist/component/stack/style.d.ts.map +1 -0
  32. package/dist/component/stack/style.js +12 -0
  33. package/dist/component/stack/style.js.map +1 -0
  34. package/dist/component/tag/index.d.ts +1 -1
  35. package/dist/component/tag/index.d.ts.map +1 -1
  36. package/dist/component/tag/index.js.map +1 -1
  37. package/dist/component/tag/style.d.ts +1 -1
  38. package/dist/component/tag/style.d.ts.map +1 -1
  39. package/dist/component/text/index.d.ts +307 -0
  40. package/dist/component/text/index.d.ts.map +1 -0
  41. package/dist/component/text/index.js +15 -0
  42. package/dist/component/text/index.js.map +1 -0
  43. package/dist/component/text/style.d.ts +11 -0
  44. package/dist/component/text/style.d.ts.map +1 -0
  45. package/dist/component/text/style.js +48 -0
  46. package/dist/component/text/style.js.map +1 -0
  47. package/dist/control/index.d.ts +1 -1
  48. package/dist/control/index.d.ts.map +1 -1
  49. package/dist/control/index.js +1 -1
  50. package/dist/control/index.js.map +1 -1
  51. package/dist/control/popover/index.d.ts +24 -8
  52. package/dist/control/popover/index.d.ts.map +1 -1
  53. package/dist/control/popover/index.js +60 -15
  54. package/dist/control/popover/index.js.map +1 -1
  55. package/dist/control/popover/position.d.ts +47 -0
  56. package/dist/control/popover/position.d.ts.map +1 -0
  57. package/dist/control/popover/position.js +29 -0
  58. package/dist/control/popover/position.js.map +1 -0
  59. package/dist/theme/theme.d.ts +25 -0
  60. package/dist/theme/theme.d.ts.map +1 -1
  61. package/dist/theme/theme.js +43 -1
  62. package/dist/theme/theme.js.map +1 -1
  63. package/docs/component/heading.md +85 -0
  64. package/docs/component/inline.md +64 -0
  65. package/docs/component/meta-line.md +13 -17
  66. package/docs/component/metadata-list.md +1 -1
  67. package/docs/component/stack.md +68 -0
  68. package/docs/component/tag.md +26 -6
  69. package/docs/component/text.md +94 -0
  70. package/docs/control/popover.md +41 -10
  71. package/docs/patterns.md +28 -9
  72. package/docs/theme.md +10 -9
  73. package/docs/tokens.md +4 -4
  74. package/package.json +1 -1
  75. package/src/component/heading/index.tsx +64 -0
  76. package/src/component/heading/style.ts +5 -0
  77. package/src/component/index.ts +4 -0
  78. package/src/component/inline/index.tsx +57 -0
  79. package/src/component/inline/style.ts +18 -0
  80. package/src/component/stack/gap.ts +16 -0
  81. package/src/component/stack/index.tsx +49 -0
  82. package/src/component/stack/style.ts +12 -0
  83. package/src/component/tag/index.tsx +1 -1
  84. package/src/component/text/index.tsx +61 -0
  85. package/src/component/text/style.ts +67 -0
  86. package/src/control/index.ts +6 -1
  87. package/src/control/popover/index.tsx +77 -19
  88. package/src/control/popover/position.ts +66 -0
  89. package/src/theme/theme.ts +59 -2
@@ -0,0 +1,307 @@
1
+ import type { HTMLAttributes, ReactNode, Ref } from 'react';
2
+ import { type TextSize, type TextTone, type TextWeight } from './style.js';
3
+ export interface TextProps extends Omit<HTMLAttributes<HTMLElement>, 'style'> {
4
+ /** The element to render. Default `'span'`. */
5
+ as?: 'span' | 'p' | 'div' | 'label' | 'strong' | 'em';
6
+ /** Font size, from the theme's `fontSize` tokens. Unset inherits. */
7
+ size?: TextSize;
8
+ /** Text colour: `primary`, `secondary`, `muted`, `faint`, `description`, or `danger`/`success` for inline error and confirmation text. Unset inherits. */
9
+ tone?: TextTone;
10
+ /** Font weight, from the theme's `fontWeight` tokens. Unset inherits. */
11
+ weight?: TextWeight;
12
+ /** Clip to one line with an ellipsis. Inline elements become `inline-block` so the clip applies. Default `false`. */
13
+ truncate?: boolean;
14
+ /** The id of the control this label describes. Only for `as="label"`. */
15
+ htmlFor?: string;
16
+ /** Extra class on the root. Override with `'&&'` specificity, never `!important`. */
17
+ className?: string;
18
+ /** The text. */
19
+ children?: ReactNode;
20
+ /** Ref to the root element. */
21
+ ref?: Ref<HTMLElement>;
22
+ }
23
+ /** A run of text with themed size, tone and weight. Unset props inherit from the parent. */
24
+ export declare const Text: ({ as, size, tone, weight, truncate, className, children, ref, ...rest }: TextProps) => import("react").DetailedReactHTMLElement<{
25
+ dangerouslySetInnerHTML?: {
26
+ __html: string | TrustedHTML;
27
+ } | undefined;
28
+ onCopy?: import("react").ClipboardEventHandler<HTMLElement> | undefined;
29
+ onCopyCapture?: import("react").ClipboardEventHandler<HTMLElement> | undefined;
30
+ onCut?: import("react").ClipboardEventHandler<HTMLElement> | undefined;
31
+ onCutCapture?: import("react").ClipboardEventHandler<HTMLElement> | undefined;
32
+ onPaste?: import("react").ClipboardEventHandler<HTMLElement> | undefined;
33
+ onPasteCapture?: import("react").ClipboardEventHandler<HTMLElement> | undefined;
34
+ onCompositionEnd?: import("react").CompositionEventHandler<HTMLElement> | undefined;
35
+ onCompositionEndCapture?: import("react").CompositionEventHandler<HTMLElement> | undefined;
36
+ onCompositionStart?: import("react").CompositionEventHandler<HTMLElement> | undefined;
37
+ onCompositionStartCapture?: import("react").CompositionEventHandler<HTMLElement> | undefined;
38
+ onCompositionUpdate?: import("react").CompositionEventHandler<HTMLElement> | undefined;
39
+ onCompositionUpdateCapture?: import("react").CompositionEventHandler<HTMLElement> | undefined;
40
+ onFocus?: import("react").FocusEventHandler<HTMLElement> | undefined;
41
+ onFocusCapture?: import("react").FocusEventHandler<HTMLElement> | undefined;
42
+ onBlur?: import("react").FocusEventHandler<HTMLElement> | undefined;
43
+ onBlurCapture?: import("react").FocusEventHandler<HTMLElement> | undefined;
44
+ onChange?: import("react").ChangeEventHandler<HTMLElement, Element> | undefined;
45
+ onChangeCapture?: import("react").ChangeEventHandler<HTMLElement, Element> | undefined;
46
+ onBeforeInput?: import("react").InputEventHandler<HTMLElement> | undefined;
47
+ onBeforeInputCapture?: import("react").InputEventHandler<HTMLElement> | undefined;
48
+ onInput?: import("react").InputEventHandler<HTMLElement> | undefined;
49
+ onInputCapture?: import("react").InputEventHandler<HTMLElement> | undefined;
50
+ onReset?: import("react").ReactEventHandler<HTMLElement> | undefined;
51
+ onResetCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
52
+ onSubmit?: import("react").SubmitEventHandler<HTMLElement> | undefined;
53
+ onSubmitCapture?: import("react").SubmitEventHandler<HTMLElement> | undefined;
54
+ onInvalid?: import("react").ReactEventHandler<HTMLElement> | undefined;
55
+ onInvalidCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
56
+ onLoad?: import("react").ReactEventHandler<HTMLElement> | undefined;
57
+ onLoadCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
58
+ onError?: import("react").ReactEventHandler<HTMLElement> | undefined;
59
+ onErrorCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
60
+ onKeyDown?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
61
+ onKeyDownCapture?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
62
+ onKeyPress?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
63
+ onKeyPressCapture?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
64
+ onKeyUp?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
65
+ onKeyUpCapture?: import("react").KeyboardEventHandler<HTMLElement> | undefined;
66
+ onAbort?: import("react").ReactEventHandler<HTMLElement> | undefined;
67
+ onAbortCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
68
+ onCanPlay?: import("react").ReactEventHandler<HTMLElement> | undefined;
69
+ onCanPlayCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
70
+ onCanPlayThrough?: import("react").ReactEventHandler<HTMLElement> | undefined;
71
+ onCanPlayThroughCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
72
+ onDurationChange?: import("react").ReactEventHandler<HTMLElement> | undefined;
73
+ onDurationChangeCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
74
+ onEmptied?: import("react").ReactEventHandler<HTMLElement> | undefined;
75
+ onEmptiedCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
76
+ onEncrypted?: import("react").ReactEventHandler<HTMLElement> | undefined;
77
+ onEncryptedCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
78
+ onEnded?: import("react").ReactEventHandler<HTMLElement> | undefined;
79
+ onEndedCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
80
+ onLoadedData?: import("react").ReactEventHandler<HTMLElement> | undefined;
81
+ onLoadedDataCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
82
+ onLoadedMetadata?: import("react").ReactEventHandler<HTMLElement> | undefined;
83
+ onLoadedMetadataCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
84
+ onLoadStart?: import("react").ReactEventHandler<HTMLElement> | undefined;
85
+ onLoadStartCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
86
+ onPause?: import("react").ReactEventHandler<HTMLElement> | undefined;
87
+ onPauseCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
88
+ onPlay?: import("react").ReactEventHandler<HTMLElement> | undefined;
89
+ onPlayCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
90
+ onPlaying?: import("react").ReactEventHandler<HTMLElement> | undefined;
91
+ onPlayingCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
92
+ onProgress?: import("react").ReactEventHandler<HTMLElement> | undefined;
93
+ onProgressCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
94
+ onRateChange?: import("react").ReactEventHandler<HTMLElement> | undefined;
95
+ onRateChangeCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
96
+ onSeeked?: import("react").ReactEventHandler<HTMLElement> | undefined;
97
+ onSeekedCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
98
+ onSeeking?: import("react").ReactEventHandler<HTMLElement> | undefined;
99
+ onSeekingCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
100
+ onStalled?: import("react").ReactEventHandler<HTMLElement> | undefined;
101
+ onStalledCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
102
+ onSuspend?: import("react").ReactEventHandler<HTMLElement> | undefined;
103
+ onSuspendCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
104
+ onTimeUpdate?: import("react").ReactEventHandler<HTMLElement> | undefined;
105
+ onTimeUpdateCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
106
+ onVolumeChange?: import("react").ReactEventHandler<HTMLElement> | undefined;
107
+ onVolumeChangeCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
108
+ onWaiting?: import("react").ReactEventHandler<HTMLElement> | undefined;
109
+ onWaitingCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
110
+ onAuxClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
111
+ onAuxClickCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
112
+ onClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
113
+ onClickCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
114
+ onContextMenu?: import("react").MouseEventHandler<HTMLElement> | undefined;
115
+ onContextMenuCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
116
+ onDoubleClick?: import("react").MouseEventHandler<HTMLElement> | undefined;
117
+ onDoubleClickCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
118
+ onDrag?: import("react").DragEventHandler<HTMLElement> | undefined;
119
+ onDragCapture?: import("react").DragEventHandler<HTMLElement> | undefined;
120
+ onDragEnd?: import("react").DragEventHandler<HTMLElement> | undefined;
121
+ onDragEndCapture?: import("react").DragEventHandler<HTMLElement> | undefined;
122
+ onDragEnter?: import("react").DragEventHandler<HTMLElement> | undefined;
123
+ onDragEnterCapture?: import("react").DragEventHandler<HTMLElement> | undefined;
124
+ onDragExit?: import("react").DragEventHandler<HTMLElement> | undefined;
125
+ onDragExitCapture?: import("react").DragEventHandler<HTMLElement> | undefined;
126
+ onDragLeave?: import("react").DragEventHandler<HTMLElement> | undefined;
127
+ onDragLeaveCapture?: import("react").DragEventHandler<HTMLElement> | undefined;
128
+ onDragOver?: import("react").DragEventHandler<HTMLElement> | undefined;
129
+ onDragOverCapture?: import("react").DragEventHandler<HTMLElement> | undefined;
130
+ onDragStart?: import("react").DragEventHandler<HTMLElement> | undefined;
131
+ onDragStartCapture?: import("react").DragEventHandler<HTMLElement> | undefined;
132
+ onDrop?: import("react").DragEventHandler<HTMLElement> | undefined;
133
+ onDropCapture?: import("react").DragEventHandler<HTMLElement> | undefined;
134
+ onMouseDown?: import("react").MouseEventHandler<HTMLElement> | undefined;
135
+ onMouseDownCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
136
+ onMouseEnter?: import("react").MouseEventHandler<HTMLElement> | undefined;
137
+ onMouseLeave?: import("react").MouseEventHandler<HTMLElement> | undefined;
138
+ onMouseMove?: import("react").MouseEventHandler<HTMLElement> | undefined;
139
+ onMouseMoveCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
140
+ onMouseOut?: import("react").MouseEventHandler<HTMLElement> | undefined;
141
+ onMouseOutCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
142
+ onMouseOver?: import("react").MouseEventHandler<HTMLElement> | undefined;
143
+ onMouseOverCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
144
+ onMouseUp?: import("react").MouseEventHandler<HTMLElement> | undefined;
145
+ onMouseUpCapture?: import("react").MouseEventHandler<HTMLElement> | undefined;
146
+ onSelect?: import("react").ReactEventHandler<HTMLElement> | undefined;
147
+ onSelectCapture?: import("react").ReactEventHandler<HTMLElement> | undefined;
148
+ onTouchCancel?: import("react").TouchEventHandler<HTMLElement> | undefined;
149
+ onTouchCancelCapture?: import("react").TouchEventHandler<HTMLElement> | undefined;
150
+ onTouchEnd?: import("react").TouchEventHandler<HTMLElement> | undefined;
151
+ onTouchEndCapture?: import("react").TouchEventHandler<HTMLElement> | undefined;
152
+ onTouchMove?: import("react").TouchEventHandler<HTMLElement> | undefined;
153
+ onTouchMoveCapture?: import("react").TouchEventHandler<HTMLElement> | undefined;
154
+ onTouchStart?: import("react").TouchEventHandler<HTMLElement> | undefined;
155
+ onTouchStartCapture?: import("react").TouchEventHandler<HTMLElement> | undefined;
156
+ onPointerDown?: import("react").PointerEventHandler<HTMLElement> | undefined;
157
+ onPointerDownCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
158
+ onPointerMove?: import("react").PointerEventHandler<HTMLElement> | undefined;
159
+ onPointerMoveCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
160
+ onPointerUp?: import("react").PointerEventHandler<HTMLElement> | undefined;
161
+ onPointerUpCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
162
+ onPointerCancel?: import("react").PointerEventHandler<HTMLElement> | undefined;
163
+ onPointerCancelCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
164
+ onPointerEnter?: import("react").PointerEventHandler<HTMLElement> | undefined;
165
+ onPointerLeave?: import("react").PointerEventHandler<HTMLElement> | undefined;
166
+ onPointerOver?: import("react").PointerEventHandler<HTMLElement> | undefined;
167
+ onPointerOverCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
168
+ onPointerOut?: import("react").PointerEventHandler<HTMLElement> | undefined;
169
+ onPointerOutCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
170
+ onGotPointerCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
171
+ onGotPointerCaptureCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
172
+ onLostPointerCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
173
+ onLostPointerCaptureCapture?: import("react").PointerEventHandler<HTMLElement> | undefined;
174
+ onScroll?: import("react").UIEventHandler<HTMLElement> | undefined;
175
+ onScrollCapture?: import("react").UIEventHandler<HTMLElement> | undefined;
176
+ onScrollEnd?: import("react").UIEventHandler<HTMLElement> | undefined;
177
+ onScrollEndCapture?: import("react").UIEventHandler<HTMLElement> | undefined;
178
+ onWheel?: import("react").WheelEventHandler<HTMLElement> | undefined;
179
+ onWheelCapture?: import("react").WheelEventHandler<HTMLElement> | undefined;
180
+ onAnimationStart?: import("react").AnimationEventHandler<HTMLElement> | undefined;
181
+ onAnimationStartCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
182
+ onAnimationEnd?: import("react").AnimationEventHandler<HTMLElement> | undefined;
183
+ onAnimationEndCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
184
+ onAnimationIteration?: import("react").AnimationEventHandler<HTMLElement> | undefined;
185
+ onAnimationIterationCapture?: import("react").AnimationEventHandler<HTMLElement> | undefined;
186
+ onToggle?: import("react").ToggleEventHandler<HTMLElement> | undefined;
187
+ onBeforeToggle?: import("react").ToggleEventHandler<HTMLElement> | undefined;
188
+ onTransitionCancel?: import("react").TransitionEventHandler<HTMLElement> | undefined;
189
+ onTransitionCancelCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
190
+ onTransitionEnd?: import("react").TransitionEventHandler<HTMLElement> | undefined;
191
+ onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
192
+ onTransitionRun?: import("react").TransitionEventHandler<HTMLElement> | undefined;
193
+ onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
194
+ onTransitionStart?: import("react").TransitionEventHandler<HTMLElement> | undefined;
195
+ onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLElement> | undefined;
196
+ "aria-activedescendant"?: string | undefined;
197
+ "aria-atomic"?: ("false" | "true" | boolean) | undefined;
198
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
199
+ "aria-braillelabel"?: string | undefined;
200
+ "aria-brailleroledescription"?: string | undefined;
201
+ "aria-busy"?: ("false" | "true" | boolean) | undefined;
202
+ "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
203
+ "aria-colcount"?: number | undefined;
204
+ "aria-colindex"?: number | undefined;
205
+ "aria-colindextext"?: string | undefined;
206
+ "aria-colspan"?: number | undefined;
207
+ "aria-controls"?: string | undefined;
208
+ "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
209
+ "aria-describedby"?: string | undefined;
210
+ "aria-description"?: string | undefined;
211
+ "aria-details"?: string | undefined;
212
+ "aria-disabled"?: ("false" | "true" | boolean) | undefined;
213
+ "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
214
+ "aria-errormessage"?: string | undefined;
215
+ "aria-expanded"?: ("false" | "true" | boolean) | undefined;
216
+ "aria-flowto"?: string | undefined;
217
+ "aria-grabbed"?: ("false" | "true" | boolean) | undefined;
218
+ "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
219
+ "aria-hidden"?: ("false" | "true" | boolean) | undefined;
220
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
221
+ "aria-keyshortcuts"?: string | undefined;
222
+ "aria-label"?: string | undefined;
223
+ "aria-labelledby"?: string | undefined;
224
+ "aria-level"?: number | undefined;
225
+ "aria-live"?: "off" | "assertive" | "polite" | undefined;
226
+ "aria-modal"?: ("false" | "true" | boolean) | undefined;
227
+ "aria-multiline"?: ("false" | "true" | boolean) | undefined;
228
+ "aria-multiselectable"?: ("false" | "true" | boolean) | undefined;
229
+ "aria-orientation"?: "horizontal" | "vertical" | undefined;
230
+ "aria-owns"?: string | undefined;
231
+ "aria-placeholder"?: string | undefined;
232
+ "aria-posinset"?: number | undefined;
233
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
234
+ "aria-readonly"?: ("false" | "true" | boolean) | undefined;
235
+ "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
236
+ "aria-required"?: ("false" | "true" | boolean) | undefined;
237
+ "aria-roledescription"?: string | undefined;
238
+ "aria-rowcount"?: number | undefined;
239
+ "aria-rowindex"?: number | undefined;
240
+ "aria-rowindextext"?: string | undefined;
241
+ "aria-rowspan"?: number | undefined;
242
+ "aria-selected"?: ("false" | "true" | boolean) | undefined;
243
+ "aria-setsize"?: number | undefined;
244
+ "aria-sort"?: "none" | "ascending" | "descending" | "other" | undefined;
245
+ "aria-valuemax"?: number | undefined;
246
+ "aria-valuemin"?: number | undefined;
247
+ "aria-valuenow"?: number | undefined;
248
+ "aria-valuetext"?: string | undefined;
249
+ defaultChecked?: boolean | undefined;
250
+ defaultValue?: string | number | readonly string[] | undefined;
251
+ suppressContentEditableWarning?: boolean | undefined;
252
+ suppressHydrationWarning?: boolean | undefined;
253
+ accessKey?: string | undefined;
254
+ autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {});
255
+ autoFocus?: boolean | undefined;
256
+ contentEditable?: ("false" | "true" | boolean) | "inherit" | "plaintext-only" | undefined;
257
+ contextMenu?: string | undefined;
258
+ dir?: string | undefined;
259
+ draggable?: ("false" | "true" | boolean) | undefined;
260
+ enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
261
+ hidden?: boolean | undefined;
262
+ id?: string | undefined;
263
+ lang?: string | undefined;
264
+ nonce?: string | undefined;
265
+ slot?: string | undefined;
266
+ spellCheck?: ("false" | "true" | boolean) | undefined;
267
+ tabIndex?: number | undefined;
268
+ title?: string | undefined;
269
+ translate?: "yes" | "no" | undefined;
270
+ radioGroup?: string | undefined;
271
+ role?: import("react").AriaRole | undefined;
272
+ about?: string | undefined;
273
+ content?: string | undefined;
274
+ datatype?: string | undefined;
275
+ inlist?: any;
276
+ prefix?: string | undefined;
277
+ property?: string | undefined;
278
+ rel?: string | undefined;
279
+ resource?: string | undefined;
280
+ rev?: string | undefined;
281
+ typeof?: string | undefined;
282
+ vocab?: string | undefined;
283
+ autoCorrect?: string | undefined;
284
+ autoSave?: string | undefined;
285
+ color?: string | undefined;
286
+ itemProp?: string | undefined;
287
+ itemScope?: boolean | undefined;
288
+ itemType?: string | undefined;
289
+ itemID?: string | undefined;
290
+ itemRef?: string | undefined;
291
+ results?: number | undefined;
292
+ security?: string | undefined;
293
+ unselectable?: "on" | "off" | undefined;
294
+ popover?: "" | "auto" | "manual" | "hint" | undefined;
295
+ popoverTargetAction?: "toggle" | "show" | "hide" | undefined;
296
+ popoverTarget?: string | undefined;
297
+ inert?: boolean | undefined;
298
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
299
+ is?: string | undefined;
300
+ exportparts?: string | undefined;
301
+ part?: string | undefined;
302
+ /** The id of the control this label describes. Only for `as="label"`. */
303
+ htmlFor?: string;
304
+ ref: Ref<HTMLElement> | undefined;
305
+ className: string;
306
+ }, HTMLElement>;
307
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/component/text/index.tsx"],"names":[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eAwCjB,CAAC"}
@@ -0,0 +1,15 @@
1
+ import cx from 'classnames';
2
+ import { createElement } from 'react';
3
+ import { useStyle, useTypography } from './style.js';
4
+ const INLINE_TAGS = ['span', 'strong', 'em', 'label'];
5
+ /** A run of text with themed size, tone and weight. Unset props inherit from the parent. */
6
+ export const Text = ({ as = 'span', size, tone, weight, truncate = false, className, children, ref, ...rest }) => {
7
+ const style = useStyle();
8
+ const type = useTypography();
9
+ return createElement(as, {
10
+ ...rest,
11
+ ref,
12
+ className: cx(style.root, size && type[`size-${size}`], tone && type[`tone-${tone}`], weight && type[`weight-${weight}`], truncate && type.truncate, truncate && INLINE_TAGS.includes(as) && type.truncateInline, className),
13
+ }, children);
14
+ };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/component/text/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAiD,MAAM,YAAY,CAAC;AAEpG,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAuBtD,4FAA4F;AAC5F,MAAM,CAAC,MAAM,IAAI,GAAG,CAAC,EACnB,EAAE,GAAG,MAAM,EACX,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,QAAQ,EACR,GAAG,EACH,GAAG,IAAI,EACG,EAAE,EAAE;IACd,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,IAAI,GAAG,aAAa,EAAE,CAAC;IAC7B,OAAO,aAAa,CAClB,EAAE,EACF;QACE,GAAG,IAAI;QACP,GAAG;QACH,SAAS,EAAE,EAAE,CACX,KAAK,CAAC,IAAI,EACV,IAAI,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,EAC5B,IAAI,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC,EAC5B,MAAM,IAAI,IAAI,CAAC,UAAU,MAAM,EAAE,CAAC,EAClC,QAAQ,IAAI,IAAI,CAAC,QAAQ,EACzB,QAAQ,IAAI,WAAW,CAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,cAAc,EAC3D,SAAS,CACV;KACF,EACD,QAAQ,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import cx from 'classnames';\nimport type { HTMLAttributes, ReactNode, Ref } from 'react';\nimport { createElement } from 'react';\n\nimport { useStyle, useTypography, type TextSize, type TextTone, type TextWeight } from './style.js';\n\nconst INLINE_TAGS = ['span', 'strong', 'em', 'label'];\n\nexport interface TextProps extends Omit<HTMLAttributes<HTMLElement>, 'style'> {\n /** The element to render. Default `'span'`. */\n as?: 'span' | 'p' | 'div' | 'label' | 'strong' | 'em';\n /** Font size, from the theme's `fontSize` tokens. Unset inherits. */\n size?: TextSize;\n /** Text colour: `primary`, `secondary`, `muted`, `faint`, `description`, or `danger`/`success` for inline error and confirmation text. Unset inherits. */\n tone?: TextTone;\n /** Font weight, from the theme's `fontWeight` tokens. Unset inherits. */\n weight?: TextWeight;\n /** Clip to one line with an ellipsis. Inline elements become `inline-block` so the clip applies. Default `false`. */\n truncate?: boolean;\n /** The id of the control this label describes. Only for `as=\"label\"`. */\n htmlFor?: string;\n /** Extra class on the root. Override with `'&&'` specificity, never `!important`. */\n className?: string;\n /** The text. */\n children?: ReactNode;\n /** Ref to the root element. */\n ref?: Ref<HTMLElement>;\n}\n\n/** A run of text with themed size, tone and weight. Unset props inherit from the parent. */\nexport const Text = ({\n as = 'span',\n size,\n tone,\n weight,\n truncate = false,\n className,\n children,\n ref,\n ...rest\n}: TextProps) => {\n const style = useStyle();\n const type = useTypography();\n return createElement(\n as,\n {\n ...rest,\n ref,\n className: cx(\n style.root,\n size && type[`size-${size}`],\n tone && type[`tone-${tone}`],\n weight && type[`weight-${weight}`],\n truncate && type.truncate,\n truncate && INLINE_TAGS.includes(as) && type.truncateInline,\n className\n ),\n },\n children\n );\n};\n"]}
@@ -0,0 +1,11 @@
1
+ import { type Theme } from '../../theme/index.js';
2
+ export type TextSize = keyof Theme['fontSize'];
3
+ export type TextTone = 'primary' | 'secondary' | 'muted' | 'faint' | 'description' | 'danger' | 'success';
4
+ export type TextWeight = keyof Theme['fontWeight'];
5
+ export declare const useTypography: (data?: {
6
+ theme?: Theme | undefined;
7
+ } | undefined) => import("jss").Classes<"size-lg" | "size-md" | "size-sm" | "size-xl" | "size-xs" | "size-xxl" | "size-xxs" | "tone-danger" | "tone-description" | "tone-faint" | "tone-muted" | "tone-primary" | "tone-secondary" | "tone-success" | "truncate" | "truncateInline" | "weight-bold" | "weight-extrabold" | "weight-medium" | "weight-regular" | "weight-semibold">;
8
+ export declare const useStyle: (data?: {
9
+ theme?: Jss.Theme | undefined;
10
+ } | undefined) => import("jss").Classes<"root">;
11
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["../../../src/component/text/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,UAAU,CAAC,CAAC;AAC/C,MAAM,MAAM,QAAQ,GAChB,SAAS,GACT,WAAW,GACX,OAAO,GACP,OAAO,GACP,aAAa,GACb,QAAQ,GACR,SAAS,CAAC;AACd,MAAM,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,YAAY,CAAC,CAAC;AAmDnD,eAAO,MAAM,aAAa;;kXAA4D,CAAC;AAEvF,eAAO,MAAM,QAAQ;;+CAElB,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { createUseStyles } from '../../theme/index.js';
2
+ const toneColor = (theme, tone) => {
3
+ if (tone === 'danger')
4
+ return theme.color.chip.danger.text;
5
+ if (tone === 'success')
6
+ return theme.color.chip.success.text;
7
+ return theme.color.text[tone];
8
+ };
9
+ const TONES = [
10
+ 'primary',
11
+ 'secondary',
12
+ 'muted',
13
+ 'faint',
14
+ 'description',
15
+ 'danger',
16
+ 'success',
17
+ ];
18
+ // One static rule per token value, so a prop is a class swap rather than a
19
+ // dynamic style sheet. Shared with Heading.
20
+ const typographyRules = (theme) => ({
21
+ ...Object.fromEntries(Object.keys(theme.fontSize).map((size) => [
22
+ `size-${size}`,
23
+ { fontSize: theme.fontSize[size] },
24
+ ])),
25
+ ...Object.fromEntries(TONES.map((tone) => [`tone-${tone}`, { color: toneColor(theme, tone) }])),
26
+ ...Object.fromEntries(Object.keys(theme.fontWeight).map((weight) => [
27
+ `weight-${weight}`,
28
+ { fontWeight: theme.fontWeight[weight] },
29
+ ])),
30
+ truncate: {
31
+ overflow: 'hidden',
32
+ textOverflow: 'ellipsis',
33
+ whiteSpace: 'nowrap',
34
+ minWidth: 0,
35
+ // A start, centre or end aligned flex item sizes to its content, so cap it.
36
+ maxWidth: '100%',
37
+ },
38
+ // Inline elements ignore overflow and width, so they become inline-block.
39
+ truncateInline: {
40
+ display: 'inline-block',
41
+ verticalAlign: 'bottom',
42
+ },
43
+ });
44
+ export const useTypography = createUseStyles((theme) => typographyRules(theme));
45
+ export const useStyle = createUseStyles(() => ({
46
+ root: { margin: 0 },
47
+ }));
48
+ //# sourceMappingURL=style.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.js","sourceRoot":"","sources":["../../../src/component/text/style.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,sBAAsB,CAAC;AAanE,MAAM,SAAS,GAAG,CAAC,KAAY,EAAE,IAAc,EAAU,EAAE;IACzD,IAAI,IAAI,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IAC3D,IAAI,IAAI,KAAK,SAAS;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C1E,cAAc,EAAE;QACd,OAAO,EAAE,cAAc;QACvB,aAAa,EAAE,QAAQ;KACxB;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,KAAY,EAAE,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,QAAQ,GAAG,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC;IAC7C,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE;CACpB,CAAC,CAAC,CAAC","sourcesContent":["import { createUseStyles, type Theme } from '../../theme/index.js';\n\nexport type TextSize = keyof Theme['fontSize'];\nexport type TextTone =\n | 'primary'\n | 'secondary'\n | 'muted'\n | 'faint'\n | 'description'\n | 'danger'\n | 'success';\nexport type TextWeight = keyof Theme['fontWeight'];\n\nconst toneColor = (theme: Theme, tone: TextTone): string => {\n if (tone === 'danger') return theme.color.chip.danger.text;\n if (tone === 'success') return theme.color.chip.success.text;\n return theme.color.text[tone];\n};\n\nconst TONES: TextTone[] = [\n 'primary',\n 'secondary',\n 'muted',\n 'faint',\n 'description',\n 'danger',\n 'success',\n];\n\n// One static rule per token value, so a prop is a class swap rather than a\n// dynamic style sheet. Shared with Heading.\nconst typographyRules = (theme: Theme) => ({\n ...(Object.fromEntries(\n (Object.keys(theme.fontSize) as TextSize[]).map((size) => [\n `size-${size}`,\n { fontSize: theme.fontSize[size] },\n ])\n ) as Record<`size-${TextSize}`, object>),\n ...(Object.fromEntries(\n TONES.map((tone) => [`tone-${tone}`, { color: toneColor(theme, tone) }])\n ) as Record<`tone-${TextTone}`, object>),\n ...(Object.fromEntries(\n (Object.keys(theme.fontWeight) as TextWeight[]).map((weight) => [\n `weight-${weight}`,\n { fontWeight: theme.fontWeight[weight] },\n ])\n ) as Record<`weight-${TextWeight}`, object>),\n truncate: {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n minWidth: 0,\n // A start, centre or end aligned flex item sizes to its content, so cap it.\n maxWidth: '100%',\n },\n // Inline elements ignore overflow and width, so they become inline-block.\n truncateInline: {\n display: 'inline-block',\n verticalAlign: 'bottom',\n },\n});\n\nexport const useTypography = createUseStyles((theme: Theme) => typographyRules(theme));\n\nexport const useStyle = createUseStyles(() => ({\n root: { margin: 0 },\n}));\n"]}
@@ -8,7 +8,7 @@ export { NumberInput, type NumberInputProps } from './number-input/index.js';
8
8
  export { PageActionsBar, type PageActionsBarProps } from './page-actions-bar/index.js';
9
9
  export { PageActionsMenu, type PageActionIntentProps, type PageActionItem, type PageActionsMenuProps, } from './page-actions-menu/index.js';
10
10
  export { PageFooterActions, type FooterAction, type PageFooterActionsProps, } from './page-footer-actions/index.js';
11
- export { Popover, type PopoverProps } from './popover/index.js';
11
+ export { Popover, type PopoverAlign, type PopoverProps, type PopoverSide, } from './popover/index.js';
12
12
  export { Select, type SelectOption, type SelectProps } from './select/index.js';
13
13
  export { SegmentedControl, type SegmentedControlProps, type SegmentedOption, } from './segmented-control/index.js';
14
14
  export { Switch, type SwitchProps, type SwitchRadiusValue } from './switch/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EACL,MAAM,EACN,KAAK,WAAW,EAChB,KAAK,iBAAiB,EACtB,KAAK,eAAe,GACrB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EACL,SAAS,EACT,KAAK,gBAAgB,EACrB,K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,7 @@ export { NumberInput } from './number-input/index.js';
8
8
  export { PageActionsBar } from './page-actions-bar/index.js';
9
9
  export { PageActionsMenu, } from './page-actions-menu/index.js';
10
10
  export { PageFooterActions, } from './page-footer-actions/index.js';
11
- export { Popover } from './popover/index.js';
11
+ export { Popover, } from './popover/index.js';
12
12
  export { Select } from './select/index.js';
13
13
  export { SegmentedControl, } from './segmented-control/index.js';
14
14
  export { Switch } from './switch/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EACL,MAAM,GAIP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAwC,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,aAAa,EAA2B,MAAM,4BAA4B,CAAC;AACpF,OAAO,EACL,SAAS,GAIV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAyB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAA4B,MAAM,6BAA6B,CAAC;AACvF,OAAO,EACL,eAAe,GAIhB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,iBAAiB,GAGlB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,OAAO,EAAqB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAuC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,gBAAgB,GAGjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,MAAM,EAA4C,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAsB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,SAAS,EAA6C,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { BackButton, type BackButtonProps } from './back-button/index.js';\nexport {\n Button,\n type ButtonProps,\n type ButtonRadiusValue,\n type ButtonTypeValue,\n} from './button/index.js';\nexport { ChipsInput, type ChipColor, type ChipsInputProps } from './chips-input/index.js';\nexport { ConfirmModal, type ConfirmModalProps } from './confirm-modal/index.js';\nexport { DateTimeInput, type DateTimeInputProps } from './date-time-input/index.js';\nexport {\n FieldList,\n type ColumnDescriptor,\n type FieldListProps,\n type FieldRow,\n} from './field-list/index.js';\nexport { NumberInput, type NumberInputProps } from './number-input/index.js';\nexport { PageActionsBar, type PageActionsBarProps } from './page-actions-bar/index.js';\nexport {\n PageActionsMenu,\n type PageActionIntentProps,\n type PageActionItem,\n type PageActionsMenuProps,\n} from './page-actions-menu/index.js';\nexport {\n PageFooterActions,\n type FooterAction,\n type PageFooterActionsProps,\n} from './page-footer-actions/index.js';\nexport { Popover, type PopoverProps } from './popover/index.js';\nexport { Select, type SelectOption, type SelectProps } from './select/index.js';\nexport {\n SegmentedControl,\n type SegmentedControlProps,\n type SegmentedOption,\n} from './segmented-control/index.js';\nexport { Switch, type SwitchProps, type SwitchRadiusValue } from './switch/index.js';\nexport { TextArea, type TextAreaProps } from './text-area/index.js';\nexport { TextInput, type TextInputAction, type TextInputProps } from './text-input/index.js';\nexport { useModalDialog } from './use-modal-dialog/index.js';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAwB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EACL,MAAM,GAIP,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAwC,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,aAAa,EAA2B,MAAM,4BAA4B,CAAC;AACpF,OAAO,EACL,SAAS,GAIV,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAyB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,cAAc,EAA4B,MAAM,6BAA6B,CAAC;AACvF,OAAO,EACL,eAAe,GAIhB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,iBAAiB,GAGlB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,OAAO,GAIR,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAuC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EACL,gBAAgB,GAGjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,MAAM,EAA4C,MAAM,mBAAmB,CAAC;AACrF,OAAO,EAAE,QAAQ,EAAsB,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,SAAS,EAA6C,MAAM,uBAAuB,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC","sourcesContent":["export { BackButton, type BackButtonProps } from './back-button/index.js';\nexport {\n Button,\n type ButtonProps,\n type ButtonRadiusValue,\n type ButtonTypeValue,\n} from './button/index.js';\nexport { ChipsInput, type ChipColor, type ChipsInputProps } from './chips-input/index.js';\nexport { ConfirmModal, type ConfirmModalProps } from './confirm-modal/index.js';\nexport { DateTimeInput, type DateTimeInputProps } from './date-time-input/index.js';\nexport {\n FieldList,\n type ColumnDescriptor,\n type FieldListProps,\n type FieldRow,\n} from './field-list/index.js';\nexport { NumberInput, type NumberInputProps } from './number-input/index.js';\nexport { PageActionsBar, type PageActionsBarProps } from './page-actions-bar/index.js';\nexport {\n PageActionsMenu,\n type PageActionIntentProps,\n type PageActionItem,\n type PageActionsMenuProps,\n} from './page-actions-menu/index.js';\nexport {\n PageFooterActions,\n type FooterAction,\n type PageFooterActionsProps,\n} from './page-footer-actions/index.js';\nexport {\n Popover,\n type PopoverAlign,\n type PopoverProps,\n type PopoverSide,\n} from './popover/index.js';\nexport { Select, type SelectOption, type SelectProps } from './select/index.js';\nexport {\n SegmentedControl,\n type SegmentedControlProps,\n type SegmentedOption,\n} from './segmented-control/index.js';\nexport { Switch, type SwitchProps, type SwitchRadiusValue } from './switch/index.js';\nexport { TextArea, type TextAreaProps } from './text-area/index.js';\nexport { TextInput, type TextInputAction, type TextInputProps } from './text-input/index.js';\nexport { useModalDialog } from './use-modal-dialog/index.js';\n"]}
@@ -1,6 +1,8 @@
1
1
  import { ReactNode, RefObject } from 'react';
2
+ import { type PopoverAlign, type PopoverSide } from './position.js';
3
+ export type { PopoverAlign, PopoverSide } from './position.js';
2
4
  export type PopoverProps = {
3
- /** Element the popover aligns to (positioned directly beneath it). */
5
+ /** Element the popover aligns to (placed below or above it, per `side`). */
4
6
  anchorRef: RefObject<HTMLElement | null>;
5
7
  /** Whether the popover is rendered. */
6
8
  open: boolean;
@@ -8,23 +10,37 @@ export type PopoverProps = {
8
10
  children: ReactNode;
9
11
  /** Applied to the fixed wrapper; win specificity with `'&&'`, never `!important`. */
10
12
  className?: string;
11
- /** Vertical gap between the anchor and the popover, in pixels. */
13
+ /** Vertical gap between the anchor and the popover, in pixels; also the viewport edge margin when `matchWidth` is false. */
12
14
  gap?: number;
13
15
  /** Match the popover width to the anchor width (default true). */
14
16
  matchWidth?: boolean;
17
+ /** Preferred side; flips to the other side when this one has no room. */
18
+ side?: PopoverSide;
19
+ /** Horizontal alignment to the anchor's left edge, centre, or right edge. */
20
+ align?: PopoverAlign;
15
21
  /**
16
- * Called on a pointer-down outside both the anchor and the popover content.
17
- * Omit to opt out of outside-close handling.
22
+ * Called on a pointer-down outside both the anchor and the popover content,
23
+ * and on an Escape keydown no control has already handled. Omit to opt out.
18
24
  */
19
25
  onClose?: () => void;
20
26
  };
21
27
  /**
22
28
  * Renders `children` in a portal on `document.body`, positioned with `fixed`
23
- * coordinates directly under `anchorRef`. This lets dropdowns escape ancestors
24
- * that clip overflow (e.g. cards with rounded corners) without those ancestors
29
+ * coordinates against `anchorRef`. This lets dropdowns escape ancestors that
30
+ * clip overflow (e.g. cards with rounded corners) without those ancestors
25
31
  * having to opt out of clipping.
26
32
  *
27
- * No Escape handling or focus management, and it never flips above the anchor.
33
+ * Opens on `side` (default below) and flips when that side has no room; aligns
34
+ * per `align` and clamps horizontally to the viewport (only without
35
+ * `matchWidth`). The wrapper carries `data-side` with the side actually used.
36
+ * On the top side it is anchored by CSS `bottom`, so it stays attached as its
37
+ * content changes height. The first render is transparent (`opacity: 0`, still
38
+ * focusable) until measured, then it re-measures on scroll (capture phase),
39
+ * window resize, and content resize (`ResizeObserver`, where available).
40
+ *
41
+ * With `onClose`, Escape closes it unless the keydown was already
42
+ * `defaultPrevented`; it calls `preventDefault` so an enclosing `<dialog>`
43
+ * does not also cancel. No focus management.
28
44
  */
29
- export declare const Popover: ({ anchorRef, open, children, className, gap, matchWidth, onClose, }: PopoverProps) => import("react").ReactPortal | null;
45
+ export declare const Popover: ({ anchorRef, open, children, className, gap, matchWidth, side, align, onClose, }: PopoverProps) => import("react").ReactPortal | null;
30
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/control/popover/index.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,SAAS,EACT,SAAS,EAMV,MAAM,OAAO,CAAC;AAOf,MAAM,MAAM,YAAY,GAAG;IACzB,sEAAsE;IACtE,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,uCAAuC;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,oEAAoE;IACpE,QAAQ,EAAE,SAAS,CAAC;IACpB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,wEAQjB,Y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