@stackone/malachite 2.1.1 → 2.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.
package/dist/index.d.ts CHANGED
@@ -205,12 +205,13 @@ declare interface BaseFormComponentProps {
205
205
  hint?: string;
206
206
  tooltip?: string;
207
207
  required?: boolean;
208
+ requiredIndicator?: RequiredIndicator;
208
209
  name: FieldPath<FieldValues>;
209
210
  defaultValue?: string;
210
211
  loading?: boolean;
211
212
  formControl?: Control<FieldValues, unknown>;
212
213
  loadingComponent: default_2.ReactNode;
213
- children?: default_2.ReactNode;
214
+ children?: FormItemChildren;
214
215
  /** Accessibility wiring, from `useFormFieldIds` — see `FormFieldIds`. */
215
216
  controlId?: string;
216
217
  labelId?: string;
@@ -568,6 +569,7 @@ export declare const CustomIcons: {
568
569
  NavbarExpandIcon: FC<IconProps>;
569
570
  NotFoundIcon: FC<IconProps>;
570
571
  OrganizationIcon: FC<IconProps>;
572
+ PinIcon: FC<IconProps>;
571
573
  PlusIcon: FC<IconProps>;
572
574
  PreviewIcon: FC<IconProps>;
573
575
  ProgrammaticWebhookIcon: FC<IconProps>;
@@ -639,25 +641,9 @@ export declare enum DividerVariant {
639
641
  Emphasis = "emphasis"
640
642
  }
641
643
 
642
- export declare const Dropdown: ({ items, onItemSelected, defaultValue, value, disabled, error, label, hint, tooltip, name, required, loading, menuLoading, formControl, description, helperText, placeholder, search, clearable, size, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: DropdownProps) => JSX_2.Element;
644
+ export declare const Dropdown: ({ items, onItemSelected, defaultValue, value, disabled, error, label, hint, tooltip, name, required, requiredIndicator, loading, menuLoading, formControl, description, helperText, placeholder, search, showSubtitleInTrigger, subtitleLayout, clearable, size, id, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, }: DropdownProps) => JSX_2.Element;
643
645
 
644
- export declare interface DropdownItem {
645
- id: string;
646
- label: string;
647
- icon?: default_2.ReactNode;
648
- /** Alternate label shown in the closed trigger when selected (falls back to `label`). */
649
- triggerLabel?: string;
650
- /** Items sharing a `group` render under a section header, in first-seen order. */
651
- group?: string;
652
- /** Descriptive blurb rendered after the label in the open menu only —
653
- * the closed trigger never shows it. */
654
- subtitle?: string;
655
- rightSideText?: string;
656
- rightSideTextVariant?: 'muted' | 'primary';
657
- rightSideTextAlignment?: 'left' | 'right';
658
- }
659
-
660
- export declare interface DropdownProps {
646
+ declare interface DropdownBaseProps {
661
647
  label?: string;
662
648
  hint?: string;
663
649
  tooltip?: string;
@@ -676,9 +662,10 @@ export declare interface DropdownProps {
676
662
  formControl?: Control<FieldValues, unknown>;
677
663
  description?: string;
678
664
  required?: boolean;
665
+ requiredIndicator?: RequiredIndicator;
679
666
  helperText?: default_2.ReactNode;
680
667
  placeholder?: string;
681
- search?: boolean;
668
+ subtitleLayout?: SubtitleLayout;
682
669
  /** Adds a clear control to the trigger, reported as `onItemSelected(undefined)`. */
683
670
  clearable?: boolean;
684
671
  /** 'large' (42px) for form inputs; 'medium' (32px) for toolbar chips; 'small' (28px) beside a title. */
@@ -689,12 +676,41 @@ export declare interface DropdownProps {
689
676
  'aria-labelledby'?: string;
690
677
  }
691
678
 
679
+ export declare interface DropdownItem {
680
+ id: string;
681
+ label: string;
682
+ icon?: default_2.ReactNode;
683
+ /** Alternate label shown in the closed trigger when selected (falls back to `label`). */
684
+ triggerLabel?: string;
685
+ /** Items sharing a `group` render under a section header, in first-seen order. */
686
+ group?: string;
687
+ subtitle?: string;
688
+ rightSideText?: string;
689
+ rightSideTextVariant?: 'muted' | 'primary';
690
+ rightSideTextAlignment?: 'left' | 'right';
691
+ }
692
+
693
+ export declare type DropdownProps = DropdownBaseProps & DropdownTriggerModeProps;
694
+
692
695
  /**
693
696
  * Matches Button and the Figma component library: 28 / 32 / 42px. These names moved up a
694
697
  * tier in 0.71 — what was `xsmall`/`small`/`medium` is now `small`/`medium`/`large`.
695
698
  */
696
699
  export declare type DropdownSize = 'small' | 'medium' | 'large';
697
700
 
701
+ /**
702
+ * The search trigger is a single-line text input with nowhere for a second line, so
703
+ * `showSubtitleInTrigger` is rejected alongside `search` rather than silently ignored.
704
+ */
705
+ declare type DropdownTriggerModeProps = {
706
+ search?: false;
707
+ /** Promotes the selected item's `subtitle` into the closed trigger, beneath the value. */
708
+ showSubtitleInTrigger?: boolean;
709
+ } | {
710
+ search: true;
711
+ showSubtitleInTrigger?: never;
712
+ };
713
+
698
714
  declare interface EllipsisTextProps {
699
715
  children: default_2.ReactNode;
700
716
  tooltip?: default_2.ReactNode | string;
@@ -723,6 +739,54 @@ export declare interface EmptyLayoutProps {
723
739
  style?: default_2.CSSProperties;
724
740
  }
725
741
 
742
+ /**
743
+ * Something a form has to show but does not ask for — a computed list, a generated value —
744
+ * wearing a field's anatomy: label, content, helper text, on a field's metrics.
745
+ */
746
+ export declare const FieldBlock: default_2.FC<FieldBlockProps>;
747
+
748
+ export declare interface FieldBlockProps {
749
+ label?: string;
750
+ /** Sits beside the label — a count, a status. */
751
+ badge?: default_2.ReactNode;
752
+ /** Sits at the far end of the label row — a copy button, a link. */
753
+ action?: default_2.ReactNode;
754
+ helperText?: default_2.ReactNode;
755
+ children: default_2.ReactNode;
756
+ className?: string;
757
+ style?: default_2.CSSProperties;
758
+ }
759
+
760
+ export declare interface FieldErrorState {
761
+ error: boolean;
762
+ message?: string;
763
+ /**
764
+ * Reports an edit to the resolver only — the control keeps painting whatever value the
765
+ * consumer gives it — so a rejection clears as the field is fixed, not at the next submit.
766
+ */
767
+ onFieldChange?: (value: unknown) => void;
768
+ onFieldBlur?: () => void;
769
+ /** What this form means by "nothing chosen" — see `emptyValueOf`. */
770
+ emptyValue: unknown;
771
+ /** The value the form holds for the field, which is what a bound control must paint. */
772
+ value: unknown;
773
+ }
774
+
775
+ /**
776
+ * Fields that follow from an answer given above them — the credentials a chosen
777
+ * authentication type asks for, say — drawn as its children: indented, with a rule down the side.
778
+ */
779
+ export declare const FieldGroup: default_2.FC<FieldGroupProps>;
780
+
781
+ export declare type FieldGroupGap = 'small' | 'medium' | 'large';
782
+
783
+ export declare interface FieldGroupProps {
784
+ children: default_2.ReactNode;
785
+ gap?: FieldGroupGap;
786
+ className?: string;
787
+ style?: default_2.CSSProperties;
788
+ }
789
+
726
790
  export declare const Flex: default_2.FC<FlexProps>;
727
791
 
728
792
  export declare enum FlexAlign {
@@ -800,10 +864,12 @@ export declare const Form: default_2.FC<FormProps>;
800
864
 
801
865
  export declare const FormItem: default_2.FC<FormItemProps>;
802
866
 
867
+ export declare type FormItemChildren = default_2.ReactNode | ((state: FieldErrorState) => default_2.ReactNode);
868
+
803
869
  declare interface FormItemProps {
804
870
  control: Control<FieldValues, unknown>;
805
871
  name: FieldPath<FieldValues>;
806
- children: default_2.ReactNode;
872
+ children: FormItemChildren;
807
873
  }
808
874
 
809
875
  declare interface FormProps {
@@ -814,6 +880,24 @@ declare interface FormProps {
814
880
  className?: string;
815
881
  }
816
882
 
883
+ /**
884
+ * Names a group of fields in a form and rules off the space beside it. Quieter than
885
+ * `Typography.FormSectionTitle`, which titles a form rather than dividing one.
886
+ */
887
+ export declare const FormSectionHeading: default_2.FC<FormSectionHeadingProps>;
888
+
889
+ export declare type FormSectionHeadingLevel = 2 | 3 | 4 | 5 | 6;
890
+
891
+ export declare interface FormSectionHeadingProps {
892
+ children: default_2.ReactNode;
893
+ /** The rule that runs from the label to the edge of the section. */
894
+ rule?: boolean;
895
+ /** Where the section sits in the page's heading hierarchy. */
896
+ level?: FormSectionHeadingLevel;
897
+ className?: string;
898
+ style?: default_2.CSSProperties;
899
+ }
900
+
817
901
  declare interface FormSectionTitleProps {
818
902
  children: default_2.ReactNode;
819
903
  className?: string;
@@ -857,6 +941,7 @@ declare interface InputProps {
857
941
  size?: InputSize;
858
942
  variant?: InputVariant;
859
943
  required?: boolean;
944
+ requiredIndicator?: RequiredIndicator;
860
945
  error?: boolean;
861
946
  loading?: boolean;
862
947
  defaultValue?: string;
@@ -869,6 +954,8 @@ declare interface InputProps {
869
954
  onCopyClick?: () => void;
870
955
  showCopyButton?: boolean;
871
956
  onChange?: (value: string) => void;
957
+ /** Controlled value, for a source of truth outside the form (URL, app state). */
958
+ value?: string;
872
959
  onBlur?: () => void;
873
960
  helperText?: string;
874
961
  showPasswordToggle?: boolean;
@@ -1382,6 +1469,7 @@ declare interface MultiSelectBaseProps {
1382
1469
  tooltip?: string;
1383
1470
  hint?: string;
1384
1471
  required?: boolean;
1472
+ requiredIndicator?: RequiredIndicator;
1385
1473
  /** Show selected values as chips instead of "N selected" text */
1386
1474
  chips?: boolean;
1387
1475
  /** Show × button on each chip to remove it (only when chips=true) */
@@ -1695,6 +1783,8 @@ declare type RenderBreadcrumbLink = (props: {
1695
1783
  'aria-label'?: string;
1696
1784
  }) => default_2.ReactNode;
1697
1785
 
1786
+ export declare type RequiredIndicator = 'optional-suffix' | 'asterisk' | 'none';
1787
+
1698
1788
  /**
1699
1789
  * Reset theme to default values
1700
1790
  */
@@ -2119,6 +2209,8 @@ export declare interface StepTabsProps {
2119
2209
  className?: string;
2120
2210
  }
2121
2211
 
2212
+ export declare type SubtitleLayout = 'inline' | 'stacked';
2213
+
2122
2214
  export declare const Surface: SurfaceComponent;
2123
2215
 
2124
2216
  declare interface SurfaceComponent extends default_2.FC<SurfaceProps> {
@@ -2387,6 +2479,7 @@ declare interface TextAreaProps {
2387
2479
  description?: string;
2388
2480
  size?: TextAreaSize;
2389
2481
  required?: boolean;
2482
+ requiredIndicator?: RequiredIndicator;
2390
2483
  error?: boolean;
2391
2484
  loading?: boolean;
2392
2485
  defaultValue?: string;
@@ -2400,6 +2493,7 @@ declare interface TextAreaProps {
2400
2493
  onChange?: (value: string) => void;
2401
2494
  value?: string;
2402
2495
  onBlur?: () => void;
2496
+ helperText?: string;
2403
2497
  rows?: number;
2404
2498
  maxLength?: number;
2405
2499
  resize?: 'none' | 'vertical' | 'horizontal' | 'both';
@@ -2522,6 +2616,10 @@ declare interface TooltipProps {
2522
2616
  * suppress the tooltip for this interaction. Lets wrappers defer expensive
2523
2617
  * checks (e.g. truncation measurement) to interaction time instead of mount. */
2524
2618
  shouldShow?: () => boolean;
2619
+ triggerAs?: 'div' | 'span';
2620
+ /** Whether the tooltip acts as the trigger's accessible description. False where the
2621
+ * trigger already points at the same sentence on screen, so it is not announced twice. */
2622
+ describesTrigger?: boolean;
2525
2623
  }
2526
2624
 
2527
2625
  /**
package/dist/index.js CHANGED
@@ -1,98 +1,101 @@
1
- import { A as s, c as t, d as o, e as r, f as i, g as n, B as l, h as p, i as d, j as c, k as S, l as T, m, n as u, o as g, p as h, q as C, r as y, s as B, D as w, t as F, u as x, v as A, F as b, w as L, x as P, y as f, z as v, E as k, G as D, H as z, I as R, J as M, K as I, L as N, M as V, N as E, O as G, P as H, Q as j, R as q, S as J, T as K, U as O, V as W, W as Q, X as U, Y as X, Z as Y, $ as Z, a0 as $, a1 as _, a2 as aa, a3 as ea, a4 as sa, a5 as ta, a6 as oa, a7 as ra, a8 as ia, a9 as na, aa as la, ab as pa, ac as da, ad as ca, ae as Sa, af as Ta, ag as ma, ah as ua, ai as ga, aj as ha, ak as Ca, al as ya, am as Ba, an as wa, ao as Fa, ap as xa, aq as Aa, ar as ba, as as La, at as Pa, au as fa, av as va, aw as ka, ax as Da, ay as za, az as Ra, aA as Ma, aB as Ia, aC as Na, aD as Va, aE as Ea, aF as Ga, aG as Ha, aH as ja } from "./index-CrkMcfzV.js";
1
+ import { A as s, c as t, d as o, e as i, f as r, g as n, B as l, h as p, i as d, j as c, k as S, l as m, m as T, n as u, o as g, p as h, q as C, r as F, s as B, D as y, t as w, u as x, v as A, F as b, w as L, x as P, y as f, z as k, E as v, G as D, H as z, I as R, J as I, K as M, L as G, M as H, N, O as V, P as E, Q as J, R as K, S as j, T as q, U as O, V as W, W as Q, X as U, Y as X, Z as Y, $ as Z, a0 as $, a1 as _, a2 as aa, a3 as ea, a4 as sa, a5 as ta, a6 as oa, a7 as ia, a8 as ra, a9 as na, aa as la, ab as pa, ac as da, ad as ca, ae as Sa, af as ma, ag as Ta, ah as ua, ai as ga, aj as ha, ak as Ca, al as Fa, am as Ba, an as ya, ao as wa, ap as xa, aq as Aa, ar as ba, as as La, at as Pa, au as fa, av as ka, aw as va, ax as Da, ay as za, az as Ra, aA as Ia, aB as Ma, aC as Ga, aD as Ha, aE as Na, aF as Va, aG as Ea, aH as Ja, aI as Ka, aJ as ja, aK as qa } from "./index-BX79s-B-.js";
2
2
  export {
3
3
  s as Accordion,
4
4
  t as ActionBar,
5
5
  o as ActionMenu,
6
- r as Alert,
7
- i as AppLogo,
6
+ i as Alert,
7
+ r as AppLogo,
8
8
  n as Avatar,
9
9
  l as BaseFormComponent,
10
10
  p as Breadcrumbs,
11
11
  d as Button,
12
12
  c as ButtonList,
13
13
  S as Card,
14
- T as CardStrip,
15
- m as Checkbox,
14
+ m as CardStrip,
15
+ T as Checkbox,
16
16
  u as ClampText,
17
17
  g as CodeBlock,
18
18
  h as CollapsibleSection,
19
19
  C as Confetti,
20
- y as ConnectionHeader,
20
+ F as ConnectionHeader,
21
21
  B as CustomIcons,
22
- w as DefinitionRow,
23
- F as Divider,
22
+ y as DefinitionRow,
23
+ w as Divider,
24
24
  x as DividerVariant,
25
25
  A as Dropdown,
26
- b as Flex,
27
- L as FlexAlign,
28
- P as FlexDirection,
29
- f as FlexGapSize,
30
- v as FlexJustify,
31
- k as FooterLinks,
32
- D as FooterNav,
33
- z as Form,
34
- R as FormItem,
35
- M as Input,
36
- I as KeyValueList,
37
- N as Link,
38
- V as LoadingBar,
39
- E as MalachiteContext,
40
- G as MultiSelect,
41
- H as NumberTag,
42
- j as OverflowRow,
43
- q as Padded,
44
- J as PaddingSize,
45
- K as PageActions,
46
- O as PageLayout,
47
- W as PillButton,
48
- Q as PreviewTree,
49
- U as PreviewTreeRow,
50
- X as Progress,
51
- Y as Radio,
52
- Z as Search,
53
- $ as SegmentedControl,
54
- _ as SelectableCard,
55
- aa as SelectionBar,
56
- ea as SettingRow,
57
- sa as ShadowEscape,
58
- ta as SidePanel,
59
- oa as SidePanelNavFooter,
60
- ra as Skeleton,
61
- ia as Spacer,
62
- na as SpacingSize,
63
- la as Spinner,
64
- pa as SplitScreenLayout,
65
- da as StatBadge,
66
- ca as Statistic,
67
- Sa as StatusBadge,
68
- Ta as StepTabs,
69
- ma as Stepper,
70
- ua as Surface,
71
- ga as SurfaceRow,
72
- ha as Swatch,
73
- Ca as Table,
74
- ya as Tabs,
75
- Ba as Tag,
76
- wa as TextArea,
77
- Fa as ThemeScope,
78
- xa as Toggle,
79
- Aa as Toolbar,
80
- ba as Tooltip,
81
- La as TruncatedTooltip,
82
- Pa as Typography,
83
- fa as WizardLayout,
84
- va as applyCustomTheme,
85
- ka as applyDarkTheme,
86
- Da as applyLightTheme,
87
- za as applyTheme,
88
- Ra as applyThemeVars,
89
- Ma as buildActionBarMenuItems,
90
- Ia as darkTheme,
91
- Na as defaultTheme,
92
- Va as getCurrentTheme,
93
- Ea as getCurrentThemeMode,
94
- Ga as initializeTheme,
95
- Ha as resetTheme,
96
- ja as toggleTheme
26
+ b as FieldBlock,
27
+ L as FieldGroup,
28
+ P as Flex,
29
+ f as FlexAlign,
30
+ k as FlexDirection,
31
+ v as FlexGapSize,
32
+ D as FlexJustify,
33
+ z as FooterLinks,
34
+ R as FooterNav,
35
+ I as Form,
36
+ M as FormItem,
37
+ G as FormSectionHeading,
38
+ H as Input,
39
+ N as KeyValueList,
40
+ V as Link,
41
+ E as LoadingBar,
42
+ J as MalachiteContext,
43
+ K as MultiSelect,
44
+ j as NumberTag,
45
+ q as OverflowRow,
46
+ O as Padded,
47
+ W as PaddingSize,
48
+ Q as PageActions,
49
+ U as PageLayout,
50
+ X as PillButton,
51
+ Y as PreviewTree,
52
+ Z as PreviewTreeRow,
53
+ $ as Progress,
54
+ _ as Radio,
55
+ aa as Search,
56
+ ea as SegmentedControl,
57
+ sa as SelectableCard,
58
+ ta as SelectionBar,
59
+ oa as SettingRow,
60
+ ia as ShadowEscape,
61
+ ra as SidePanel,
62
+ na as SidePanelNavFooter,
63
+ la as Skeleton,
64
+ pa as Spacer,
65
+ da as SpacingSize,
66
+ ca as Spinner,
67
+ Sa as SplitScreenLayout,
68
+ ma as StatBadge,
69
+ Ta as Statistic,
70
+ ua as StatusBadge,
71
+ ga as StepTabs,
72
+ ha as Stepper,
73
+ Ca as Surface,
74
+ Fa as SurfaceRow,
75
+ Ba as Swatch,
76
+ ya as Table,
77
+ wa as Tabs,
78
+ xa as Tag,
79
+ Aa as TextArea,
80
+ ba as ThemeScope,
81
+ La as Toggle,
82
+ Pa as Toolbar,
83
+ fa as Tooltip,
84
+ ka as TruncatedTooltip,
85
+ va as Typography,
86
+ Da as WizardLayout,
87
+ za as applyCustomTheme,
88
+ Ra as applyDarkTheme,
89
+ Ia as applyLightTheme,
90
+ Ma as applyTheme,
91
+ Ga as applyThemeVars,
92
+ Ha as buildActionBarMenuItems,
93
+ Na as darkTheme,
94
+ Va as defaultTheme,
95
+ Ea as getCurrentTheme,
96
+ Ja as getCurrentThemeMode,
97
+ Ka as initializeTheme,
98
+ ja as resetTheme,
99
+ qa as toggleTheme
97
100
  };
98
101
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stackone/malachite",
3
- "version": "2.1.1",
3
+ "version": "2.2.1",
4
4
  "description": "StackOne's themeable React component library — Shadow DOM isolated, scoped Tailwind, theme-token driven.",
5
5
  "license": "MIT",
6
6
  "author": "StackOne",