@hussmartinez/ui 0.7.0 → 0.9.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/README.md +3 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +198 -1
- package/dist/react.js +314 -33
- package/dist/react.js.map +1 -1
- package/dist/shared/{pair-DLVFV6vU.js → pair-pt-vUVwu.js} +2 -1
- package/dist/shared/pair-pt-vUVwu.js.map +1 -0
- package/dist/styles.css +112 -0
- package/dist/ui.d.ts +198 -1
- package/package.json +5 -5
- package/dist/shared/pair-DLVFV6vU.js.map +0 -1
package/dist/react.d.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { RefAttributes } from 'react';
|
|
|
24
24
|
import { RefObject } from 'react';
|
|
25
25
|
import type { ShortcutPart } from '@hussmartinez/sdk-core';
|
|
26
26
|
import type { SVGProps } from 'react';
|
|
27
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* The `add` icon: Lucide's `plus`.
|
|
@@ -62,6 +63,13 @@ export declare interface AnnouncerProviderProps {
|
|
|
62
63
|
readonly children?: ReactNode;
|
|
63
64
|
}
|
|
64
65
|
|
|
66
|
+
/**
|
|
67
|
+
* The `arrow` icon: Lucide's `move-up-right`.
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export declare function ArrowIcon(props: IconProps): ReactElement;
|
|
72
|
+
|
|
65
73
|
/**
|
|
66
74
|
* A button: a native `<button>`, `type="button"` unless you say otherwise.
|
|
67
75
|
*
|
|
@@ -168,6 +176,68 @@ export declare type ClassNames<Part extends string> = {
|
|
|
168
176
|
*/
|
|
169
177
|
export declare function CloseIcon(props: IconProps): ReactElement;
|
|
170
178
|
|
|
179
|
+
/**
|
|
180
|
+
* A colour input: a hex field with a preview of the colour, and optional
|
|
181
|
+
* swatches to pick from. It works with the keyboard alone and doesn't use
|
|
182
|
+
* the browser's own colour picker, which differs between browsers and can't
|
|
183
|
+
* be themed or translated.
|
|
184
|
+
*
|
|
185
|
+
* - **The input** takes `#rrggbb`, `#rgb` or either without the `#`. Typing
|
|
186
|
+
* doesn't change the value: the text is committed on blur or Enter. Text
|
|
187
|
+
* that isn't a colour goes back to the last value, and Escape throws the
|
|
188
|
+
* typing away.
|
|
189
|
+
* - **The swatches** are a radio group: one Tab stop, and the arrow keys move
|
|
190
|
+
* and select. A swatch is checked while the value is its colour.
|
|
191
|
+
* - **The value** is always lowercase `#rrggbb`. With `name`, forms receive it.
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* ```tsx
|
|
195
|
+
* <Field label={t("shape.fill")}>
|
|
196
|
+
* <ColorField
|
|
197
|
+
* value={fill}
|
|
198
|
+
* onValueChange={setFill}
|
|
199
|
+
* swatches={[
|
|
200
|
+
* { value: "#d92d20", label: t("colors.red") },
|
|
201
|
+
* { value: "#1570ef", label: t("colors.blue") },
|
|
202
|
+
* ]}
|
|
203
|
+
* />
|
|
204
|
+
* </Field>
|
|
205
|
+
* ```
|
|
206
|
+
*
|
|
207
|
+
* @public
|
|
208
|
+
*/
|
|
209
|
+
export declare const ColorField: ForwardRefExoticComponent<ColorFieldProps & RefAttributes<HTMLDivElement>>;
|
|
210
|
+
|
|
211
|
+
/**
|
|
212
|
+
* The parts of a colour field that `classNames` can target.
|
|
213
|
+
*
|
|
214
|
+
* @public
|
|
215
|
+
*/
|
|
216
|
+
export declare type ColorFieldPart = "root" | "control" | "preview" | "input" | "swatches" | "swatch";
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Props of {@link ColorField}. Other props go to the hex input.
|
|
220
|
+
*
|
|
221
|
+
* @public
|
|
222
|
+
*/
|
|
223
|
+
export declare interface ColorFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "className" | "type" | "value" | "defaultValue" | "onChange">, StyleProps<ColorFieldPart> {
|
|
224
|
+
/** The colour, as `#rrggbb`. With it, the field is controlled. */
|
|
225
|
+
readonly value?: string | undefined;
|
|
226
|
+
/** The first colour of an uncontrolled field. Defaults to `#000000`. */
|
|
227
|
+
readonly defaultValue?: string | undefined;
|
|
228
|
+
/** Called with the new colour, always as lowercase `#rrggbb`. */
|
|
229
|
+
readonly onValueChange?: ((value: string) => void) | undefined;
|
|
230
|
+
/** Colours to pick from, shown under the input. Leave it out for the input alone. */
|
|
231
|
+
readonly swatches?: readonly ColorSwatch[] | undefined;
|
|
232
|
+
/**
|
|
233
|
+
* The accessible name, such as "Fill". Leave it out inside a `Field`, or
|
|
234
|
+
* when a visible `<label>` points at the field's `id`.
|
|
235
|
+
*/
|
|
236
|
+
readonly label?: string | undefined;
|
|
237
|
+
/** The word that follows the label in the swatch group's name. Defaults to "swatches". */
|
|
238
|
+
readonly swatchesLabel?: string | undefined;
|
|
239
|
+
}
|
|
240
|
+
|
|
171
241
|
/**
|
|
172
242
|
* How a subtree picks between light and dark: one of them, or whichever the
|
|
173
243
|
* operating system prefers (`prefers-color-scheme`).
|
|
@@ -176,6 +246,18 @@ export declare function CloseIcon(props: IconProps): ReactElement;
|
|
|
176
246
|
*/
|
|
177
247
|
export declare type ColorMode = "light" | "dark" | "system";
|
|
178
248
|
|
|
249
|
+
/**
|
|
250
|
+
* A colour a {@link ColorField} offers as a swatch.
|
|
251
|
+
*
|
|
252
|
+
* @public
|
|
253
|
+
*/
|
|
254
|
+
export declare interface ColorSwatch {
|
|
255
|
+
/** The colour, as `#rrggbb` or `#rgb`. */
|
|
256
|
+
readonly value: string;
|
|
257
|
+
/** The swatch's accessible name, such as "Red". Use text from your message catalogue. */
|
|
258
|
+
readonly label: string;
|
|
259
|
+
}
|
|
260
|
+
|
|
179
261
|
/**
|
|
180
262
|
* The `crop` icon: Lucide's `crop`.
|
|
181
263
|
*
|
|
@@ -269,6 +351,20 @@ export declare interface DialogProps extends Omit<DialogHTMLAttributes<HTMLDialo
|
|
|
269
351
|
*/
|
|
270
352
|
export declare function DownloadIcon(props: IconProps): ReactElement;
|
|
271
353
|
|
|
354
|
+
/**
|
|
355
|
+
* The `duplicate` icon: Lucide's `copy`.
|
|
356
|
+
*
|
|
357
|
+
* @public
|
|
358
|
+
*/
|
|
359
|
+
export declare function DuplicateIcon(props: IconProps): ReactElement;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* The `ellipse` icon: Lucide's `ellipse`.
|
|
363
|
+
*
|
|
364
|
+
* @public
|
|
365
|
+
*/
|
|
366
|
+
export declare function EllipseIcon(props: IconProps): ReactElement;
|
|
367
|
+
|
|
272
368
|
/**
|
|
273
369
|
* The `fade-in` icon: Lucide's `chart-no-axes-column-increasing`.
|
|
274
370
|
*
|
|
@@ -475,6 +571,13 @@ export declare function FlipHorizontalIcon(props: IconProps): ReactElement;
|
|
|
475
571
|
*/
|
|
476
572
|
export declare function FlipVerticalIcon(props: IconProps): ReactElement;
|
|
477
573
|
|
|
574
|
+
/**
|
|
575
|
+
* The `hidden` icon: Lucide's `eye-off`.
|
|
576
|
+
*
|
|
577
|
+
* @public
|
|
578
|
+
*/
|
|
579
|
+
export declare function HiddenIcon(props: IconProps): ReactElement;
|
|
580
|
+
|
|
478
581
|
/**
|
|
479
582
|
* The `highlighter` icon: Lucide's `highlighter`.
|
|
480
583
|
*
|
|
@@ -523,7 +626,7 @@ export declare type IconComponent = (props: IconProps) => ReactElement;
|
|
|
523
626
|
*
|
|
524
627
|
* @public
|
|
525
628
|
*/
|
|
526
|
-
export declare type IconName = "add" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "close" | "crop" | "delete" | "download" | "fade-in" | "fade-out" | "fit" | "flip-horizontal" | "flip-vertical" | "highlighter" | "info" | "loop" | "menu" | "more" | "muted" | "open" | "page-grid" | "page-single" | "pan" | "pause" | "pen" | "play" | "redo" | "remove" | "rotate-left" | "rotate-right" | "search" | "select" | "skip-back" | "skip-forward" | "snap" | "split" | "stop" | "trim-end" | "trim-start" | "undo" | "upload" | "volume" | "warning" | "zoom-in" | "zoom-out";
|
|
629
|
+
export declare type IconName = "add" | "arrow" | "check" | "chevron-down" | "chevron-left" | "chevron-right" | "close" | "crop" | "delete" | "download" | "duplicate" | "ellipse" | "fade-in" | "fade-out" | "fit" | "flip-horizontal" | "flip-vertical" | "hidden" | "highlighter" | "info" | "layers" | "loop" | "menu" | "more" | "move-down" | "move-up" | "muted" | "open" | "page-add" | "page-grid" | "page-single" | "pan" | "pause" | "pen" | "play" | "rectangle" | "redact" | "redo" | "remove" | "rotate-left" | "rotate-right" | "search" | "select" | "skip-back" | "skip-forward" | "snap" | "split" | "stop" | "text" | "trim-end" | "trim-start" | "undo" | "upload" | "visible" | "volume" | "warning" | "zoom-in" | "zoom-out";
|
|
527
630
|
|
|
528
631
|
/**
|
|
529
632
|
* Props of every icon. SVG attributes are passed through.
|
|
@@ -546,6 +649,13 @@ export declare interface IconProps extends Omit<SVGProps<SVGSVGElement>, "childr
|
|
|
546
649
|
*/
|
|
547
650
|
export declare function InfoIcon(props: IconProps): ReactElement;
|
|
548
651
|
|
|
652
|
+
/**
|
|
653
|
+
* The `layers` icon: Lucide's `layers`.
|
|
654
|
+
*
|
|
655
|
+
* @public
|
|
656
|
+
*/
|
|
657
|
+
export declare function LayersIcon(props: IconProps): ReactElement;
|
|
658
|
+
|
|
549
659
|
/**
|
|
550
660
|
* The `loop` icon: Lucide's `repeat`.
|
|
551
661
|
*
|
|
@@ -567,6 +677,20 @@ export declare function MenuIcon(props: IconProps): ReactElement;
|
|
|
567
677
|
*/
|
|
568
678
|
export declare function MoreIcon(props: IconProps): ReactElement;
|
|
569
679
|
|
|
680
|
+
/**
|
|
681
|
+
* The `move-down` icon: Lucide's `arrow-down`.
|
|
682
|
+
*
|
|
683
|
+
* @public
|
|
684
|
+
*/
|
|
685
|
+
export declare function MoveDownIcon(props: IconProps): ReactElement;
|
|
686
|
+
|
|
687
|
+
/**
|
|
688
|
+
* The `move-up` icon: Lucide's `arrow-up`.
|
|
689
|
+
*
|
|
690
|
+
* @public
|
|
691
|
+
*/
|
|
692
|
+
export declare function MoveUpIcon(props: IconProps): ReactElement;
|
|
693
|
+
|
|
570
694
|
/**
|
|
571
695
|
* The `muted` icon: Lucide's `volume-x`.
|
|
572
696
|
*
|
|
@@ -661,6 +785,13 @@ export declare interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLI
|
|
|
661
785
|
*/
|
|
662
786
|
export declare function OpenIcon(props: IconProps): ReactElement;
|
|
663
787
|
|
|
788
|
+
/**
|
|
789
|
+
* The `page-add` icon: Lucide's `file-plus`.
|
|
790
|
+
*
|
|
791
|
+
* @public
|
|
792
|
+
*/
|
|
793
|
+
export declare function PageAddIcon(props: IconProps): ReactElement;
|
|
794
|
+
|
|
664
795
|
/**
|
|
665
796
|
* The `page-grid` icon: Lucide's `grid-2x2`.
|
|
666
797
|
*
|
|
@@ -743,6 +874,20 @@ export declare interface ProgressBarProps extends Omit<ProgressHTMLAttributes<HT
|
|
|
743
874
|
readonly valueText?: string | undefined;
|
|
744
875
|
}
|
|
745
876
|
|
|
877
|
+
/**
|
|
878
|
+
* The `rectangle` icon: Lucide's `rectangle-horizontal`.
|
|
879
|
+
*
|
|
880
|
+
* @public
|
|
881
|
+
*/
|
|
882
|
+
export declare function RectangleIcon(props: IconProps): ReactElement;
|
|
883
|
+
|
|
884
|
+
/**
|
|
885
|
+
* The `redact` icon: Lucide's `rectangle-ellipsis`.
|
|
886
|
+
*
|
|
887
|
+
* @public
|
|
888
|
+
*/
|
|
889
|
+
export declare function RedactIcon(props: IconProps): ReactElement;
|
|
890
|
+
|
|
746
891
|
/**
|
|
747
892
|
* The `redo` icon: Lucide's `redo-2`, mirrored in right-to-left text.
|
|
748
893
|
*
|
|
@@ -994,6 +1139,43 @@ export declare interface StyleProps<Part extends string> {
|
|
|
994
1139
|
readonly unstyled?: boolean | undefined;
|
|
995
1140
|
}
|
|
996
1141
|
|
|
1142
|
+
/**
|
|
1143
|
+
* A multi-line text input, styled like `TextField`, with its tokens. `rows`
|
|
1144
|
+
* sets its height, three by default, and the user can drag it taller. Inside
|
|
1145
|
+
* a `Field`, it takes the field's label, description and error.
|
|
1146
|
+
*
|
|
1147
|
+
* Enter adds a line, so it doesn't submit a form. Its value separates lines
|
|
1148
|
+
* with `\n`, whatever was pasted.
|
|
1149
|
+
*
|
|
1150
|
+
* @example
|
|
1151
|
+
* ```tsx
|
|
1152
|
+
* <Field label={t("text.content")}>
|
|
1153
|
+
* <TextArea value={text} onValueChange={setText} rows={4} />
|
|
1154
|
+
* </Field>
|
|
1155
|
+
* ```
|
|
1156
|
+
*
|
|
1157
|
+
* @public
|
|
1158
|
+
*/
|
|
1159
|
+
export declare const TextArea: ForwardRefExoticComponent<TextAreaProps & RefAttributes<HTMLTextAreaElement>>;
|
|
1160
|
+
|
|
1161
|
+
/**
|
|
1162
|
+
* Props of {@link TextArea}. Native textarea props are passed through, so it
|
|
1163
|
+
* works controlled with `value` and `onChange`, or uncontrolled with
|
|
1164
|
+
* `defaultValue`.
|
|
1165
|
+
*
|
|
1166
|
+
* @public
|
|
1167
|
+
*/
|
|
1168
|
+
export declare interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "className">, StyleProps<"root"> {
|
|
1169
|
+
/** Called with the new text as it changes, as well as `onChange`. */
|
|
1170
|
+
readonly onValueChange?: ((value: string) => void) | undefined;
|
|
1171
|
+
/**
|
|
1172
|
+
* The accessible name, such as "Caption". Leave it out inside a `Field`,
|
|
1173
|
+
* or when a visible `<label>` points at the field's `id`, or
|
|
1174
|
+
* `aria-labelledby` names it.
|
|
1175
|
+
*/
|
|
1176
|
+
readonly label?: string | undefined;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
997
1179
|
/**
|
|
998
1180
|
* A single-line text input, styled like the family's other fields. Inside a
|
|
999
1181
|
* `Field`, it takes the field's label, description and error.
|
|
@@ -1036,6 +1218,13 @@ export declare interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInp
|
|
|
1036
1218
|
*/
|
|
1037
1219
|
export declare type TextFieldType = "text" | "search" | "email" | "url" | "tel" | "password";
|
|
1038
1220
|
|
|
1221
|
+
/**
|
|
1222
|
+
* The `text` icon: Lucide's `type`.
|
|
1223
|
+
*
|
|
1224
|
+
* @public
|
|
1225
|
+
*/
|
|
1226
|
+
export declare function TextIcon(props: IconProps): ReactElement;
|
|
1227
|
+
|
|
1039
1228
|
/**
|
|
1040
1229
|
* A validated theme. Create it with `createTheme`; its values are
|
|
1041
1230
|
* frozen and safe to write into CSS.
|
|
@@ -1403,6 +1592,7 @@ export declare type UiMessages = Messages<typeof uiMessages>;
|
|
|
1403
1592
|
* @public
|
|
1404
1593
|
*/
|
|
1405
1594
|
export declare const uiMessages: {
|
|
1595
|
+
readonly "colorField.swatches": "swatches";
|
|
1406
1596
|
readonly "dialog.close": "Close";
|
|
1407
1597
|
readonly "fileDropZone.choose": "Choose a file";
|
|
1408
1598
|
readonly "fileDropZone.chooseMultiple": "Choose files";
|
|
@@ -1496,6 +1686,13 @@ export declare function usePlatform(): Platform;
|
|
|
1496
1686
|
*/
|
|
1497
1687
|
export declare function useUiMessages(): UiMessages;
|
|
1498
1688
|
|
|
1689
|
+
/**
|
|
1690
|
+
* The `visible` icon: Lucide's `eye`.
|
|
1691
|
+
*
|
|
1692
|
+
* @public
|
|
1693
|
+
*/
|
|
1694
|
+
export declare function VisibleIcon(props: IconProps): ReactElement;
|
|
1695
|
+
|
|
1499
1696
|
/**
|
|
1500
1697
|
* Content for assistive technology only: hidden on screen, but read out and
|
|
1501
1698
|
* part of the accessible name of its parent. It has no `unstyled` prop,
|