@dnotrever2/super-kit 0.1.15 → 0.1.17

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 CHANGED
@@ -32,6 +32,94 @@ import "@dnotrever2/super-kit/dist/styles/index.css";
32
32
 
33
33
  ## Components
34
34
 
35
+ ### Accordion
36
+
37
+ Expandable content sections with single or multiple open items.
38
+
39
+ ```tsx
40
+ import { Accordion, Badge } from "@dnotrever2/super-kit";
41
+
42
+ <Accordion
43
+ defaultValue="deploy"
44
+ items={[
45
+ {
46
+ value: "deploy",
47
+ title: "Deploy pipeline",
48
+ content: "Build, test, and publish the current release."
49
+ },
50
+ {
51
+ value: "limits",
52
+ title: <>Usage limits <Badge variant="warning" pill>3</Badge></>,
53
+ content: "Requests are throttled when the workspace reaches its quota."
54
+ }
55
+ ]}
56
+ />
57
+
58
+ <Accordion
59
+ defaultValue={["deploy", "access"]}
60
+ items={items}
61
+ />
62
+
63
+ <Accordion
64
+ multiple={false}
65
+ indicator="plus-minus"
66
+ border="divider"
67
+ radius="square"
68
+ highlight="header"
69
+ spacing={0}
70
+ defaultValue="deploy"
71
+ items={items}
72
+ />
73
+
74
+ <Accordion
75
+ highlight="item"
76
+ hoverHighlight={false}
77
+ headerStyle={{ minHeight: 46, padding: "12px 16px" }}
78
+ bodyStyle={{ padding: "0 16px", color: "var(--fg-2)" }}
79
+ items={items}
80
+ />
81
+ ```
82
+
83
+ | Prop | Type | Default |
84
+ | ------------------ | ------------------------------------- | ------------------ |
85
+ | `items` | `AccordionItem[]` | required |
86
+ | `value` | `string \| string[]` | — controlled |
87
+ | `defaultValue` | `string \| string[]` | `""` or `[]` |
88
+ | `onValueChange` | `(value: string \| string[]) => void` | — |
89
+ | `multiple` | `boolean` | `true` |
90
+ | `hideIndicator` | `boolean` | `false` |
91
+ | `indicator` | `"chevron" \| "plus-minus"` | `"chevron"` |
92
+ | `border` | `"boxed" \| "none" \| "divider"` | `"boxed"` |
93
+ | `highlight` | `"none" \| "item" \| "header"` | `"none"` |
94
+ | `radius` | `"rounded" \| "square"` | `"rounded"` |
95
+ | `hoverHighlight` | `boolean` | `true` |
96
+ | `spacing` | `number \| string` | `8` |
97
+ | `disabled` | `boolean` | `false` |
98
+ | `itemClassName` | `string` | — |
99
+ | `headerClassName` | `string` | — |
100
+ | `headerStyle` | `CSSProperties` | — |
101
+ | `bodyClassName` | `string` | — |
102
+ | `bodyStyle` | `CSSProperties` | — |
103
+ | `triggerClassName` | `string` | — |
104
+ | `contentClassName` | `string` | — |
105
+
106
+ **AccordionItem fields**
107
+
108
+ | Field | Type |
109
+ | -------------- | ----------------------------------------- |
110
+ | `value` | `string` |
111
+ | `title` | `ReactNode` |
112
+ | `content` | `ReactNode` |
113
+ | `disabled` | `boolean` |
114
+ | `icon` | `ReactNode` |
115
+ | `className` | `string` |
116
+ | `triggerProps` | `ButtonHTMLAttributes<HTMLButtonElement>` |
117
+ | `contentProps` | `HTMLAttributes<HTMLDivElement>` |
118
+
119
+ By default, opening one item does not close the others. Use `multiple={false}` when only one item should stay open. Use `hideIndicator` to remove the arrow, or `indicator="plus-minus"` to show a small `+`/`-` indicator. Use `border="none"` to remove borders, `border="divider"` to show only separators between items, and `spacing` to control the gap between items. Use `radius="square"` for square corners. Use `highlight="item"` to highlight the whole open item, or `highlight="header"` to highlight only the header. Use `hoverHighlight={false}` to disable hover highlight. Use `headerClassName`/`headerStyle` and `bodyClassName`/`bodyStyle` to customize colors, height, width, padding, margin, and other layout styles.
120
+
121
+ ---
122
+
35
123
  ### Badge
36
124
 
37
125
  Status labels and tags.
@@ -198,6 +286,9 @@ import { Input } from "@dnotrever2/super-kit";
198
286
  // With icon
199
287
  <Input label="search" icon={<SearchIcon />} placeholder="Search services" />
200
288
 
289
+ // Rounded
290
+ <Input label="search" rounded placeholder="Search services" />
291
+
201
292
  // With mask — only digits allowed, formatted as 000-0000
202
293
  <Input
203
294
  label="code"
@@ -226,6 +317,7 @@ import { Input } from "@dnotrever2/super-kit";
226
317
  | `maskAllowedPattern` | `RegExp` | — |
227
318
  | `maskPlaceholder` | `string` | — |
228
319
  | `clearable` | `boolean` | `false` |
320
+ | `rounded` | `boolean` | `false` |
229
321
  | `selectOnFocus` | `boolean` | `false` |
230
322
  | `textAlign` | `"left" \| "center" \| "right"` | — |
231
323
  | `value` / `defaultValue` | `string` | `""` |
@@ -239,6 +331,83 @@ Forwards a `ref` to the underlying `<input>`.
239
331
 
240
332
  ---
241
333
 
334
+ ### DateTimeInput
335
+
336
+ Date and time input with a custom date/month picker and Super Kit styling.
337
+
338
+ ```tsx
339
+ import { DateTimeInput } from "@dnotrever2/super-kit";
340
+
341
+ <DateTimeInput label="Date" mode="date" clearable />
342
+ <DateTimeInput label="Time" mode="time" />
343
+ <DateTimeInput label="Date and time" mode="datetime" />
344
+ <DateTimeInput label="Month and year" mode="month" />
345
+
346
+ <DateTimeInput
347
+ label="Release date"
348
+ mode="date"
349
+ min="2026-05-01"
350
+ max="2026-05-31"
351
+ onValueChange={(value) => setDate(value)}
352
+ />
353
+ ```
354
+
355
+ | Prop | Type | Default |
356
+ | ------------------- | ------------------------------------------------ | -------- |
357
+ | `mode` | `"date" \| "time" \| "datetime" \| "month"` | `"date"` |
358
+ | `label` | `string` | — |
359
+ | `value` / `defaultValue` | `string` | `""` |
360
+ | `clearable` | `boolean` | `false` |
361
+ | `clearLabel` | `string` | `"Clear"` |
362
+ | `showIcon` | `boolean` | `true` |
363
+ | `openPickerOnClick` | `boolean` | `true` |
364
+ | `disabled` | `boolean` | `false` |
365
+ | `onChange` | `ChangeEvent<HTMLInputElement>` | — |
366
+ | `onValueChange` | `(value: string) => void` | — |
367
+ | `inputProps` | `InputHTMLAttributes<HTMLInputElement>` | — |
368
+ | `wrapperProps` | `HTMLAttributes<HTMLSpanElement>` | — |
369
+ | `fieldProps` | `HTMLAttributes<HTMLDivElement>` | — |
370
+
371
+ Native `min`, `max`, `step`, `required`, and other input attributes are supported. Values follow browser-native formats: `YYYY-MM-DD` for date, `HH:mm` for time, `YYYY-MM-DDTHH:mm` for datetime, and `YYYY-MM` for month.
372
+
373
+ Forwards a `ref` to the underlying `<input>`.
374
+
375
+ ---
376
+
377
+ ### Link
378
+
379
+ Text link with variants aligned to Button and Badge colors.
380
+
381
+ ```tsx
382
+ import { Link } from "@dnotrever2/super-kit";
383
+
384
+ <Link href="/docs" variant="primary">Documentation</Link>
385
+ <Link href="/status" variant="success" underlined>Status</Link>
386
+ <Link href="https://example.com" target="_blank" noreferrer>
387
+ External docs
388
+ </Link>
389
+ <Link href="/danger-zone" variant="danger" opacity={0.72}>
390
+ Danger zone
391
+ </Link>
392
+ <Link href="/settings" disabled>Settings</Link>
393
+ ```
394
+
395
+ | Prop | Type | Default |
396
+ | ------------- | --------------------------------------------------------------------------- | ----------- |
397
+ | `variant` | `"primary" \| "secondary" \| "ghost" \| "danger" \| "success" \| "warning"` | `"primary"` |
398
+ | `href` | `string` | — |
399
+ | `target` | `HTMLAttributeAnchorTarget` | — |
400
+ | `underlined` | `boolean` | `false` |
401
+ | `opacity` | `number` | `1` |
402
+ | `disabled` | `boolean` | `false` |
403
+ | `noreferrer` | `boolean` | `false` |
404
+ | `noopener` | `boolean` | `true` for `target="_blank"` |
405
+ | `icon` | `ReactNode` | — |
406
+
407
+ Forwards a `ref` to the underlying `<a>`. Accepts native anchor attributes such as `download`, `rel`, `referrerPolicy`, and `aria-*`. When `disabled`, navigation is blocked and the link is removed from the tab order.
408
+
409
+ ---
410
+
242
411
  ### Markers
243
412
 
244
413
  Form selection primitives: Checkbox, Radio, and Switch.
@@ -624,6 +793,55 @@ import { Spinner } from "@dnotrever2/super-kit";
624
793
 
625
794
  ---
626
795
 
796
+ ### Steps
797
+
798
+ Step progress indicator with circular or arrow styles.
799
+
800
+ ```tsx
801
+ import { Steps } from "@dnotrever2/super-kit";
802
+
803
+ const items = [
804
+ { label: "Step 1", description: "Configure the workspace" },
805
+ { label: "Step 2", description: "Review the changes" },
806
+ { label: "Step 3", description: "Publish the release" }
807
+ ];
808
+
809
+ <Steps items={items} currentStep={2} />
810
+
811
+ <Steps
812
+ items={items}
813
+ variant="arrow"
814
+ currentStep={2}
815
+ showNumbers={false}
816
+ />
817
+ ```
818
+
819
+ | Prop | Type | Default |
820
+ | --------------- | ---------------------------- | ------------ |
821
+ | `items` | `StepItem[]` | required |
822
+ | `currentStep` | `number` | `1` |
823
+ | `variant` | `"line" \| "arrow"` | `"line"` |
824
+ | `size` | `"sm" \| "md" \| "lg"` | `"md"` |
825
+ | `clickable` | `boolean` | `false` |
826
+ | `showNumbers` | `boolean` | `true` |
827
+ | `onStepChange` | `(step: number) => void` | — |
828
+ | `stepClassName` | `string` | — |
829
+
830
+ **StepItem fields**
831
+
832
+ | Field | Type |
833
+ | ------------- | ----------------------------------------- |
834
+ | `label` | `ReactNode` |
835
+ | `description` | `ReactNode` |
836
+ | `icon` | `ReactNode` |
837
+ | `disabled` | `boolean` |
838
+ | `className` | `string` |
839
+ | `stepProps` | `ButtonHTMLAttributes<HTMLButtonElement>` |
840
+
841
+ `currentStep` is 1-based. Completed steps are the steps before `currentStep`; the current step is highlighted.
842
+
843
+ ---
844
+
627
845
  ### Textarea
628
846
 
629
847
  Multi-line text input with custom scrollbar, character count, and clear button.
@@ -735,6 +953,10 @@ import { Tooltip } from "@dnotrever2/super-kit";
735
953
  <Tooltip content="No delay" delay={0}>
736
954
  <Button variant="primary">Deploy</Button>
737
955
  </Tooltip>
956
+
957
+ <Tooltip content="Fixed top" side="top" dynamic={false}>
958
+ <Button variant="primary">Deploy</Button>
959
+ </Tooltip>
738
960
  ```
739
961
 
740
962
  | Prop | Type | Default |
@@ -742,9 +964,13 @@ import { Tooltip } from "@dnotrever2/super-kit";
742
964
  | `content` | `ReactNode` | required |
743
965
  | `side` | `"top" \| "bottom" \| "left" \| "right"` | `"top"` |
744
966
  | `delay` | `number` (ms) | `800` |
967
+ | `dynamic` | `boolean` | `true` |
968
+ | `viewportPadding` | `number` | `8` |
745
969
  | `disabled` | `boolean` | `false` |
746
970
  | `wrapperProps` | `HTMLAttributes<HTMLSpanElement>` | — |
747
971
 
972
+ By default, the tooltip flips to the opposite side when the requested side would be clipped by the viewport.
973
+
748
974
  ---
749
975
 
750
976
  ## Design tokens
@@ -0,0 +1,42 @@
1
+ import { ButtonHTMLAttributes, CSSProperties, HTMLAttributes, ReactNode } from 'react';
2
+ export type AccordionValue = string | string[];
3
+ export type AccordionIndicator = "chevron" | "plus-minus";
4
+ export type AccordionBorder = "boxed" | "none" | "divider";
5
+ export type AccordionHighlight = "none" | "item" | "header";
6
+ export type AccordionRadius = "rounded" | "square";
7
+ export type AccordionItem = {
8
+ value: string;
9
+ title: ReactNode;
10
+ content: ReactNode;
11
+ disabled?: boolean;
12
+ icon?: ReactNode;
13
+ className?: string;
14
+ triggerProps?: ButtonHTMLAttributes<HTMLButtonElement>;
15
+ contentProps?: HTMLAttributes<HTMLDivElement>;
16
+ };
17
+ export type AccordionProps = Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> & {
18
+ items: AccordionItem[];
19
+ value?: AccordionValue;
20
+ defaultValue?: AccordionValue;
21
+ onValueChange?: (value: AccordionValue) => void;
22
+ multiple?: boolean;
23
+ hideIndicator?: boolean;
24
+ indicator?: AccordionIndicator;
25
+ border?: AccordionBorder;
26
+ highlight?: AccordionHighlight;
27
+ radius?: AccordionRadius;
28
+ hoverHighlight?: boolean;
29
+ spacing?: number | string;
30
+ disabled?: boolean;
31
+ itemClassName?: string;
32
+ headerClassName?: string;
33
+ headerStyle?: CSSProperties;
34
+ bodyClassName?: string;
35
+ bodyStyle?: CSSProperties;
36
+ triggerClassName?: string;
37
+ contentClassName?: string;
38
+ };
39
+ export declare function Accordion({ items, value, defaultValue, onValueChange, multiple, hideIndicator, indicator, border, highlight, radius, hoverHighlight, spacing, disabled, itemClassName, headerClassName, headerStyle, bodyClassName, bodyStyle, triggerClassName, contentClassName, className, style, ...props }: AccordionProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare namespace Accordion {
41
+ var displayName: string;
42
+ }
@@ -0,0 +1 @@
1
+ export * from './Accordion';
@@ -0,0 +1,34 @@
1
+ import { default as React, ButtonHTMLAttributes, ChangeEvent, HTMLAttributes, InputHTMLAttributes } from 'react';
2
+ export type DateTimeInputMode = "date" | "time" | "datetime" | "month";
3
+ export type DateTimeInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "type" | "value"> & {
4
+ mode?: DateTimeInputMode;
5
+ label?: string;
6
+ value?: string;
7
+ defaultValue?: string;
8
+ clearable?: boolean;
9
+ clearLabel?: string;
10
+ showIcon?: boolean;
11
+ openPickerOnClick?: boolean;
12
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
13
+ wrapperProps?: HTMLAttributes<HTMLSpanElement>;
14
+ fieldProps?: HTMLAttributes<HTMLDivElement>;
15
+ clearButtonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
16
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
17
+ onValueChange?: (value: string) => void;
18
+ };
19
+ export declare const DateTimeInput: React.ForwardRefExoticComponent<Omit<React.InputHTMLAttributes<HTMLInputElement>, "defaultValue" | "onChange" | "value" | "type"> & {
20
+ mode?: DateTimeInputMode;
21
+ label?: string;
22
+ value?: string;
23
+ defaultValue?: string;
24
+ clearable?: boolean;
25
+ clearLabel?: string;
26
+ showIcon?: boolean;
27
+ openPickerOnClick?: boolean;
28
+ inputProps?: InputHTMLAttributes<HTMLInputElement>;
29
+ wrapperProps?: HTMLAttributes<HTMLSpanElement>;
30
+ fieldProps?: HTMLAttributes<HTMLDivElement>;
31
+ clearButtonProps?: ButtonHTMLAttributes<HTMLButtonElement>;
32
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
33
+ onValueChange?: (value: string) => void;
34
+ } & React.RefAttributes<HTMLInputElement>>;
@@ -0,0 +1 @@
1
+ export * from './DateTimeInput';
@@ -14,6 +14,7 @@ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, "defaultVal
14
14
  maskAllowedPattern?: RegExp;
15
15
  clearable?: boolean;
16
16
  clearLabel?: string;
17
+ rounded?: boolean;
17
18
  selectOnFocus?: boolean;
18
19
  textAlign?: "left" | "center" | "right";
19
20
  inputProps?: InputHTMLAttributes<HTMLInputElement>;
@@ -34,6 +35,7 @@ export declare const Input: React.ForwardRefExoticComponent<Omit<React.InputHTML
34
35
  maskAllowedPattern?: RegExp;
35
36
  clearable?: boolean;
36
37
  clearLabel?: string;
38
+ rounded?: boolean;
37
39
  selectOnFocus?: boolean;
38
40
  textAlign?: "left" | "center" | "right";
39
41
  inputProps?: InputHTMLAttributes<HTMLInputElement>;
@@ -0,0 +1,22 @@
1
+ import { AnchorHTMLAttributes, ReactNode } from 'react';
2
+ export type LinkVariant = "primary" | "secondary" | "ghost" | "danger" | "success" | "warning";
3
+ export type LinkProps = Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "aria-disabled"> & {
4
+ variant?: LinkVariant;
5
+ underlined?: boolean;
6
+ opacity?: number;
7
+ disabled?: boolean;
8
+ noreferrer?: boolean;
9
+ noopener?: boolean;
10
+ icon?: ReactNode;
11
+ children?: ReactNode;
12
+ };
13
+ export declare const Link: import('react').ForwardRefExoticComponent<Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "aria-disabled"> & {
14
+ variant?: LinkVariant;
15
+ underlined?: boolean;
16
+ opacity?: number;
17
+ disabled?: boolean;
18
+ noreferrer?: boolean;
19
+ noopener?: boolean;
20
+ icon?: ReactNode;
21
+ children?: ReactNode;
22
+ } & import('react').RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1 @@
1
+ export * from './Link';
@@ -0,0 +1,25 @@
1
+ import { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
2
+ export type StepsVariant = "line" | "arrow";
3
+ export type StepsSize = "sm" | "md" | "lg";
4
+ export type StepItem = {
5
+ label: ReactNode;
6
+ description?: ReactNode;
7
+ icon?: ReactNode;
8
+ disabled?: boolean;
9
+ className?: string;
10
+ stepProps?: ButtonHTMLAttributes<HTMLButtonElement>;
11
+ };
12
+ export type StepsProps = Omit<HTMLAttributes<HTMLOListElement>, "onChange"> & {
13
+ items: StepItem[];
14
+ currentStep?: number;
15
+ variant?: StepsVariant;
16
+ size?: StepsSize;
17
+ clickable?: boolean;
18
+ showNumbers?: boolean;
19
+ onStepChange?: (step: number) => void;
20
+ stepClassName?: string;
21
+ };
22
+ export declare function Steps({ items, currentStep, variant, size, clickable, showNumbers, onStepChange, stepClassName, className, ...props }: StepsProps): import("react/jsx-runtime").JSX.Element;
23
+ export declare namespace Steps {
24
+ var displayName: string;
25
+ }
@@ -0,0 +1 @@
1
+ export * from './Steps';
@@ -4,11 +4,13 @@ export type TooltipProps = {
4
4
  content: ReactNode;
5
5
  side?: TooltipSide;
6
6
  delay?: number;
7
+ dynamic?: boolean;
8
+ viewportPadding?: number;
7
9
  children: ReactNode;
8
10
  wrapperProps?: HTMLAttributes<HTMLSpanElement>;
9
11
  disabled?: boolean;
10
12
  };
11
- export declare function Tooltip({ content, side, delay, children, wrapperProps, disabled }: TooltipProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function Tooltip({ content, side, delay, dynamic, viewportPadding, children, wrapperProps, disabled }: TooltipProps): import("react/jsx-runtime").JSX.Element;
12
14
  export declare namespace Tooltip {
13
15
  var displayName: string;
14
16
  }
package/dist/index.d.ts CHANGED
@@ -1,9 +1,12 @@
1
+ export * from './Accordion';
1
2
  export * from './Badge';
2
3
  export * from './Breadcrumb';
3
4
  export * from './Scrollable';
4
5
  export * from './Button';
5
6
  export * from './Card';
7
+ export * from './DateTimeInput';
6
8
  export * from './Input';
9
+ export * from './Link';
7
10
  export * from './Markers';
8
11
  export * from './Menu';
9
12
  export * from './Modal';
@@ -12,6 +15,7 @@ export * from './Progress';
12
15
  export * from './PushButton';
13
16
  export * from './Select';
14
17
  export * from './Spinner';
18
+ export * from './Steps';
15
19
  export * from './Tabs';
16
20
  export * from './Textarea';
17
21
  export * from './Toast';