tharaday 0.7.0 → 0.7.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.
@@ -2,7 +2,7 @@ import type { StorybookConfig } from '@storybook/react-vite';
2
2
 
3
3
  const config: StorybookConfig = {
4
4
  stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5
- addons: ['@storybook/addon-a11y'],
5
+ addons: ['@storybook/addon-docs', '@storybook/addon-a11y'],
6
6
  framework: '@storybook/react-vite',
7
7
  };
8
8
  export default config;
@@ -1,6 +1,8 @@
1
1
  import type { Preview } from '@storybook/react-vite';
2
2
 
3
3
  // Design system styles (foundation -> theme refs -> semantics)
4
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
5
+ // @ts-expect-error
4
6
  import '../src/styles/ds.css';
5
7
 
6
8
  const preview: Preview = {
@@ -5,6 +5,11 @@ declare const meta: {
5
5
  tags: string[];
6
6
  parameters: {
7
7
  layout: string;
8
+ docs: {
9
+ description: {
10
+ component: string;
11
+ };
12
+ };
8
13
  };
9
14
  argTypes: {
10
15
  size: {
@@ -5,6 +5,11 @@ declare const meta: {
5
5
  tags: string[];
6
6
  parameters: {
7
7
  layout: string;
8
+ docs: {
9
+ description: {
10
+ component: string;
11
+ };
12
+ };
8
13
  };
9
14
  };
10
15
  export default meta;
@@ -6,6 +6,13 @@ declare const meta: {
6
6
  Item: ({ data, label, defaultExpanded, expandIcon, collapseIcon, isRoot, }: import('./TreeItem.types').TreeItemProps) => import("react/jsx-runtime").JSX.Element;
7
7
  };
8
8
  tags: string[];
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: string;
13
+ };
14
+ };
15
+ };
9
16
  };
10
17
  export default meta;
11
18
  type Story = StoryObj<typeof meta>;
package/eslint.config.js CHANGED
@@ -1,10 +1,7 @@
1
- // For more info, see https://github.com/storybookjs/eslint-plugin-storybook#configuration-flat-config-format
2
1
  import js from '@eslint/js';
3
2
  import { defineConfig, globalIgnores } from 'eslint/config';
4
- import react from 'eslint-plugin-react';
5
3
  import reactHooks from 'eslint-plugin-react-hooks';
6
4
  import reactRefresh from 'eslint-plugin-react-refresh';
7
- import storybook from 'eslint-plugin-storybook';
8
5
  import globals from 'globals';
9
6
  import tseslint from 'typescript-eslint';
10
7
  import prettierConfig from 'eslint-config-prettier';
@@ -20,10 +17,6 @@ export default defineConfig([
20
17
  reactHooks.configs.flat.recommended,
21
18
  reactRefresh.configs.vite,
22
19
  ],
23
- plugins: {
24
- react,
25
- storybook,
26
- },
27
20
  languageOptions: {
28
21
  ecmaVersion: 2020,
29
22
  globals: globals.browser,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tharaday",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "author": "Ania Wyroba",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -78,6 +78,7 @@
78
78
  "@eslint/js": "^10.0.1",
79
79
  "@release-it/conventional-changelog": "^10.0.6",
80
80
  "@storybook/addon-a11y": "^10.3.3",
81
+ "@storybook/addon-docs": "^10.3.3",
81
82
  "@storybook/react-vite": "^10.3.3",
82
83
  "@testing-library/dom": "^10.4.0",
83
84
  "@testing-library/jest-dom": "^6.6.3",
@@ -88,11 +89,8 @@
88
89
  "@types/react-dom": "^19.2.3",
89
90
  "eslint": "^10.1.0",
90
91
  "eslint-config-prettier": "^10.1.8",
91
- "eslint-plugin-import": "^2.32.0",
92
- "eslint-plugin-react": "^7.37.5",
93
92
  "eslint-plugin-react-hooks": "^7.0.1",
94
93
  "eslint-plugin-react-refresh": "^0.5.2",
95
- "eslint-plugin-storybook": "^10.3.3",
96
94
  "globals": "^17.4.0",
97
95
  "husky": "^9.1.7",
98
96
  "jsdom": "^29.0.1",
@@ -106,12 +104,6 @@
106
104
  "vitest": "^4.1.2"
107
105
  },
108
106
  "overrides": {
109
- "eslint-plugin-import": {
110
- "eslint": "$eslint"
111
- },
112
- "eslint-plugin-react": {
113
- "eslint": "$eslint"
114
- },
115
107
  "eslint-plugin-react-hooks": {
116
108
  "eslint": "$eslint"
117
109
  },
@@ -6,6 +6,30 @@ const meta: Meta<typeof Dropdown> = {
6
6
  title: 'Components/Dropdown',
7
7
  component: Dropdown,
8
8
  tags: ['autodocs'],
9
+ parameters: {
10
+ docs: {
11
+ description: {
12
+ component: `
13
+ A custom select built on a \`button\` + \`listbox\` pattern. Supports both controlled (\`value\` + \`onChange\`) and uncontrolled (\`defaultValue\`) usage. Options can carry an optional description and can be individually disabled.
14
+
15
+ **When to use**
16
+ Use Dropdown when you need richer option rendering (descriptions, icons) or tighter visual control over the trigger. For simple native selects, use the \`Select\` component instead.
17
+
18
+ **Keyboard interaction**
19
+
20
+ | Key | Behaviour |
21
+ |-----|-----------|
22
+ | \`Enter\` / \`Space\` | Toggle open; select focused option when open |
23
+ | \`ArrowDown\` | Open list or move focus to next option |
24
+ | \`ArrowUp\` | Open list or move focus to previous option |
25
+ | \`Home\` | Move focus to first option |
26
+ | \`End\` | Move focus to last option |
27
+ | \`Escape\` | Close list and return focus to trigger |
28
+ | \`Tab\` | Close list and move focus to next element |
29
+ `,
30
+ },
31
+ },
32
+ },
9
33
  argTypes: {
10
34
  onChange: { action: 'changed' },
11
35
  },
@@ -15,6 +15,28 @@ const meta = {
15
15
  tags: ['autodocs'],
16
16
  parameters: {
17
17
  layout: 'centered',
18
+ docs: {
19
+ description: {
20
+ component: `
21
+ A dialog overlay that traps focus while open and restores it to the trigger element on close. Renders into the normal DOM tree (no portal) and is controlled via \`isOpen\` + \`onClose\`.
22
+
23
+ **Usage**
24
+ Always provide a \`title\` — it is wired to \`aria-labelledby\` on the dialog element. Pass action buttons via the \`footer\` prop to keep them visually anchored to the bottom.
25
+
26
+ **Keyboard interaction**
27
+
28
+ | Key | Behaviour |
29
+ |-----|-----------|
30
+ | \`Tab\` | Cycle focus through all focusable elements inside the modal |
31
+ | \`Shift + Tab\` | Cycle focus backwards |
32
+ | \`Escape\` | Close the modal |
33
+
34
+ **Sizes**
35
+
36
+ \`sm\` · \`md\` (default) · \`lg\` · \`xl\` · \`full\`
37
+ `,
38
+ },
39
+ },
18
40
  },
19
41
  argTypes: {
20
42
  size: {
@@ -8,6 +8,25 @@ const meta = {
8
8
  tags: ['autodocs'],
9
9
  parameters: {
10
10
  layout: 'centered',
11
+ docs: {
12
+ description: {
13
+ component: `
14
+ A tab widget implementing the [ARIA Tabs pattern](https://www.w3.org/WAI/ARIA/apg/patterns/tabs/). Supports controlled (\`activeId\` + \`onChange\`) and uncontrolled (\`defaultActiveId\`) modes. Individual tabs can be disabled. Two visual variants are available: \`line\` (default) and \`pill\`.
15
+
16
+ **Keyboard interaction**
17
+
18
+ Focus moves into the tab list on \`Tab\`. Arrow keys then navigate between tabs and automatically activate them (automatic activation pattern).
19
+
20
+ | Key | Behaviour |
21
+ |-----|-----------|
22
+ | \`ArrowRight\` / \`ArrowDown\` | Move to and activate next enabled tab (wraps) |
23
+ | \`ArrowLeft\` / \`ArrowUp\` | Move to and activate previous enabled tab (wraps) |
24
+ | \`Home\` | Move to and activate first enabled tab |
25
+ | \`End\` | Move to and activate last enabled tab |
26
+ | \`Tab\` | Move focus from tab list into the active tab panel |
27
+ `,
28
+ },
29
+ },
11
30
  },
12
31
  } satisfies Meta<typeof Tabs>;
13
32
 
@@ -7,6 +7,30 @@ const meta: Meta<typeof Tooltip> = {
7
7
  title: 'Components/Tooltip',
8
8
  component: Tooltip,
9
9
  tags: ['autodocs'],
10
+ parameters: {
11
+ docs: {
12
+ description: {
13
+ component: `
14
+ Wraps any focusable trigger element and shows supplementary content on hover or focus. The tooltip element always stays in the DOM (CSS opacity toggle) so that \`aria-describedby\` references remain valid at all times.
15
+
16
+ **Usage**
17
+ Pass a single focusable element as \`children\`. The component clones it to inject \`aria-describedby\`, so the trigger does not need to be modified manually. Use short, non-essential text — tooltips are not a substitute for visible labels.
18
+
19
+ **Keyboard interaction**
20
+
21
+ | Key | Behaviour |
22
+ |-----|-----------|
23
+ | Focus trigger | Show tooltip after \`delay\` ms |
24
+ | Blur trigger | Hide tooltip immediately |
25
+ | \`Escape\` | Hide tooltip while trigger is focused |
26
+
27
+ **Positions:** \`top\` (default) · \`bottom\` · \`left\` · \`right\`
28
+
29
+ **Variants:** \`dark\` (default) · \`light\`
30
+ `,
31
+ },
32
+ },
33
+ },
10
34
  decorators: [
11
35
  (Story) => (
12
36
  <div
@@ -5,6 +5,21 @@ const meta = {
5
5
  title: 'Components/Tree',
6
6
  component: Tree,
7
7
  tags: ['autodocs'],
8
+ parameters: {
9
+ docs: {
10
+ description: {
11
+ component: `
12
+ Renders any JavaScript value — object, array, or primitive — as an expandable tree. Useful for debugging, JSON inspection, or displaying structured data. Nested objects and arrays are collapsible; primitives and \`null\` are displayed inline.
13
+
14
+ **Usage**
15
+ Pass any serialisable value to \`data\`. Control the initial expand state with \`defaultExpanded\` (default: \`true\`). Custom expand/collapse icons can be provided via \`expandIcon\` and \`collapseIcon\`.
16
+
17
+ **Limitations**
18
+ This component is a data visualiser, not a navigation tree. It does not implement the [ARIA Tree pattern](https://www.w3.org/WAI/ARIA/apg/patterns/treeview/) — there is no keyboard navigation between nodes. For navigable trees (e.g. file explorers, side nav), a fully accessible tree widget should be used instead.
19
+ `,
20
+ },
21
+ },
22
+ },
8
23
  } satisfies Meta<typeof Tree>;
9
24
 
10
25
  export default meta;