@hyphen/hyphen-components 7.6.1 → 7.8.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 +1 -1
- package/dist/css/fonts.css +3 -3
- package/dist/css/index.css +108 -108
- package/dist/css/reset.css +3 -3
- package/dist/css/utilities.css +7 -7
- package/dist/css/variables.css +55 -57
- package/dist/hyphen-components.cjs.development.js +358 -359
- package/dist/hyphen-components.cjs.development.js.map +1 -1
- package/dist/hyphen-components.cjs.production.min.js +1 -1
- package/dist/hyphen-components.cjs.production.min.js.map +1 -1
- package/dist/hyphen-components.esm.js +3 -4
- package/dist/hyphen-components.esm.js.map +1 -1
- package/dist/index.d.ts +5 -6
- package/package.json +50 -56
- package/src/components/Calendar/Calendar.stories.tsx +1 -1
- package/src/components/Calendar/Calendar.test.tsx +7 -1
- package/src/components/Calendar/Calendar.tsx +5 -6
- package/src/components/Heading/Heading.tsx +2 -2
- package/src/components/SelectInput/SelectInput.tsx +1 -1
- package/src/components/Table/Table.stories.tsx +16 -28
- package/src/docs/Brands.mdx +14 -12
- package/src/docs/DesignTokens.mdx +1 -1
- package/src/docs/GetStarted.mdx +1 -1
- package/src/docs/intro.mdx +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,13 +4,12 @@ import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
|
|
|
4
4
|
import { BorderRadiusSize as BorderRadiusSize$1, BreakpointSize, SpacingSize, WidthSize, HeightSize, BackgroundColor, BorderColor, BorderSize, FontColor, FontFamily, FontSize, FontWeight, BoxShadowSize, TextTransform, TextWrap, ZIndexSize, IconName, HeadingSize, ColorName, BaseColor, LineHeightSize } from '@hyphen/hyphen-design-tokens/build/types';
|
|
5
5
|
export { BackgroundColor, BaseColor, BorderColor, BorderSize, BoxShadowSize, BreakpointSize, ColorName, FontColor, FontFamily, FontSize, FontWeight, HeadingSize, HeightSize, IconName, LineHeightSize, SpacingSize, TextDecorationLine, TextDecorationStyle, TextTransform, TextWrap, WhiteSpace, WidthSize, WordBreak, ZIndexSize } from '@hyphen/hyphen-design-tokens/build/types';
|
|
6
6
|
import * as CSS from 'csstype';
|
|
7
|
-
import { DayPickerProps } from 'react
|
|
8
|
-
export { Matcher } from 'react
|
|
7
|
+
import { DayPickerProps } from '@daypicker/react';
|
|
8
|
+
export { Matcher } from '@daypicker/react';
|
|
9
9
|
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
10
10
|
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
|
|
11
11
|
import { FieldAttributes, FormikTouched, FormikValues, FormikErrors } from 'formik';
|
|
12
|
-
import { OnChangeValue, OptionsOrGroups } from 'react-select';
|
|
13
|
-
import { GroupBase } from 'react-select/dist/declarations/src/types';
|
|
12
|
+
import { OnChangeValue, OptionsOrGroups, GroupBase } from 'react-select';
|
|
14
13
|
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
|
|
15
14
|
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
16
15
|
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
@@ -2005,14 +2004,14 @@ interface HeadingProps {
|
|
|
2005
2004
|
className?: string;
|
|
2006
2005
|
/**
|
|
2007
2006
|
* A variant token identifier to use for the text variant. Available variants found:
|
|
2008
|
-
* [here](https://github.com/
|
|
2007
|
+
* [here](https://github.com/Hyphen/hyphen-components/blob/main/packages/design-tokens/tokens/color/font.json).
|
|
2009
2008
|
*/
|
|
2010
2009
|
color?: FontColor;
|
|
2011
2010
|
/**
|
|
2012
2011
|
* By default, size is determined by the chosen tag (e.g. h1 is bigger than h2).
|
|
2013
2012
|
* However, size can be set independently so that its size is appropriate for the surrounding content.
|
|
2014
2013
|
* Available sizes found:
|
|
2015
|
-
* [here](https://github.com/
|
|
2014
|
+
* [here](https://github.com/Hyphen/hyphen-components/blob/main/packages/design-tokens/tokens/size/font.json).
|
|
2016
2015
|
*/
|
|
2017
2016
|
size?: HeadingSize | ResponsiveProp<HeadingSize>;
|
|
2018
2017
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyphen/hyphen-components",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "@hyphen"
|
|
@@ -15,40 +15,14 @@
|
|
|
15
15
|
],
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/Hyphen/hyphen-components.git"
|
|
19
|
-
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "cross-env IS_PUBLISHING=true tsup && cross-env IS_PUBLISHING=true webpack --config webpack.config.js && node scripts/create-cjs-shim.js",
|
|
22
|
-
"build-storybook": "storybook build",
|
|
23
|
-
"build-storybook-docs": "storybook build --docs",
|
|
24
|
-
"storybook-docs": "storybook dev --docs",
|
|
25
|
-
"lint": "eslint src --ext .ts,.tsx",
|
|
26
|
-
"lint-fix": "eslint src --ext .ts,.tsx --fix",
|
|
27
|
-
"size": "size-limit",
|
|
28
|
-
"start": "tsup --watch",
|
|
29
|
-
"storybook": "storybook dev -p 6006",
|
|
30
|
-
"test": "jest --passWithNoTests",
|
|
31
|
-
"test-watch": "jest --coverage --watch",
|
|
32
|
-
"semantic-release": "semantic-release",
|
|
33
|
-
"prepare": "npm run build",
|
|
34
|
-
"chromatic": "npx chromatic --project-token=chpt_8fddffb5556f0b7 --only-changed"
|
|
35
|
-
},
|
|
36
|
-
"husky": {
|
|
37
|
-
"hooks": {
|
|
38
|
-
"pre-commit": "eslint src --ext .ts,.tsx"
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
"prettier": {
|
|
42
|
-
"printWidth": 80,
|
|
43
|
-
"semi": true,
|
|
44
|
-
"singleQuote": true,
|
|
45
|
-
"trailingComma": "es5"
|
|
18
|
+
"url": "git+https://github.com/Hyphen/hyphen-components.git",
|
|
19
|
+
"directory": "packages/components"
|
|
46
20
|
},
|
|
47
21
|
"peerDependencies": {
|
|
48
22
|
"react": ">=16"
|
|
49
23
|
},
|
|
50
24
|
"engines": {
|
|
51
|
-
"node": ">=20"
|
|
25
|
+
"node": ">=20.19.0 <21 || >=22.12.0"
|
|
52
26
|
},
|
|
53
27
|
"size-limit": [
|
|
54
28
|
{
|
|
@@ -61,38 +35,38 @@
|
|
|
61
35
|
}
|
|
62
36
|
],
|
|
63
37
|
"dependencies": {
|
|
38
|
+
"@daypicker/react": "^10.0.1",
|
|
64
39
|
"@emotion/react": "^11.14.0",
|
|
65
|
-
"@
|
|
66
|
-
"@radix-ui/react-
|
|
67
|
-
"@radix-ui/react-
|
|
68
|
-
"@radix-ui/react-
|
|
69
|
-
"@radix-ui/react-
|
|
70
|
-
"@radix-ui/react-
|
|
71
|
-
"@radix-ui/react-toggle": "^1.1.
|
|
72
|
-
"@radix-ui/react-
|
|
73
|
-
"@radix-ui/react-tooltip": "^1.2.8",
|
|
40
|
+
"@radix-ui/react-aspect-ratio": "^1.1.9",
|
|
41
|
+
"@radix-ui/react-collapsible": "^1.1.13",
|
|
42
|
+
"@radix-ui/react-dropdown-menu": "^2.1.17",
|
|
43
|
+
"@radix-ui/react-popover": "^1.1.16",
|
|
44
|
+
"@radix-ui/react-slot": "^1.2.5",
|
|
45
|
+
"@radix-ui/react-toggle": "^1.1.11",
|
|
46
|
+
"@radix-ui/react-toggle-group": "^1.1.12",
|
|
47
|
+
"@radix-ui/react-tooltip": "^1.2.9",
|
|
74
48
|
"@types/react-modal": "^3.16.3",
|
|
75
49
|
"classnames": "^2.5.1",
|
|
76
50
|
"date-fns": "^4.1.0",
|
|
77
|
-
"formik": "^2.4.
|
|
78
|
-
"react-day-picker": "^9.11.3",
|
|
51
|
+
"formik": "^2.4.9",
|
|
79
52
|
"react-focus-lock": "^2.13.2",
|
|
80
53
|
"react-modal": "^3.16.3",
|
|
81
|
-
"react-remove-scroll": "^2.
|
|
82
|
-
"react-router-dom": "^6.
|
|
54
|
+
"react-remove-scroll": "^2.7.2",
|
|
55
|
+
"react-router-dom": "^6.30.4",
|
|
83
56
|
"react-select": "^5.10.0",
|
|
84
57
|
"react-select-event": "^5.5.1",
|
|
85
|
-
"uuid": "^11.1.
|
|
58
|
+
"uuid": "^11.1.1",
|
|
59
|
+
"@hyphen/hyphen-design-tokens": "^7.8.0"
|
|
86
60
|
},
|
|
87
61
|
"devDependencies": {
|
|
88
62
|
"@babel/core": "^7.27.4",
|
|
89
|
-
"@chromatic-com/storybook": "^
|
|
90
|
-
"@semantic-release/commit-analyzer": "^11.1.0",
|
|
63
|
+
"@chromatic-com/storybook": "^5.2.1",
|
|
91
64
|
"@size-limit/preset-small-lib": "^11.2.0",
|
|
92
|
-
"@storybook/addon-a11y": "
|
|
93
|
-
"@storybook/addon-docs": "
|
|
94
|
-
"@storybook/addon-themes": "
|
|
95
|
-
"@storybook/
|
|
65
|
+
"@storybook/addon-a11y": "10.4.2",
|
|
66
|
+
"@storybook/addon-docs": "10.4.2",
|
|
67
|
+
"@storybook/addon-themes": "10.4.2",
|
|
68
|
+
"@storybook/addon-vitest": "10.4.2",
|
|
69
|
+
"@storybook/react-vite": "10.4.2",
|
|
96
70
|
"@testing-library/jest-dom": "^6.6.3",
|
|
97
71
|
"@testing-library/react": "^16.2.0",
|
|
98
72
|
"@testing-library/user-event": "^14.6.1",
|
|
@@ -105,24 +79,30 @@
|
|
|
105
79
|
"@types/react-modal": "^3.16.3",
|
|
106
80
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
107
81
|
"@typescript-eslint/parser": "^8.0.0",
|
|
82
|
+
"@vitest/browser-playwright": "^4.1.8",
|
|
83
|
+
"@vitest/coverage-v8": "^4.1.8",
|
|
108
84
|
"autoprefixer": "^10.4.20",
|
|
109
85
|
"babel-loader": "^9.1.3",
|
|
110
|
-
"chromatic": "^13.3.
|
|
86
|
+
"chromatic": "^13.3.5",
|
|
111
87
|
"clean-webpack-plugin": "^4.0.0",
|
|
112
88
|
"cross-env": "^7.0.3",
|
|
113
89
|
"css-loader": "^6.11.0",
|
|
114
90
|
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
115
91
|
"cssnano": "^6.1.2",
|
|
116
92
|
"csstype": "^3.1.3",
|
|
93
|
+
"eslint": "^8.57.0",
|
|
117
94
|
"eslint-config-prettier": "^9.0.0",
|
|
118
95
|
"eslint-plugin-import": "^2.32.0",
|
|
119
96
|
"eslint-plugin-react": "^7.34.0",
|
|
120
97
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
121
|
-
"
|
|
98
|
+
"eslint-plugin-storybook": "10.4.2",
|
|
122
99
|
"identity-obj-proxy": "^3.0.0",
|
|
100
|
+
"jest": "^29.7.0",
|
|
123
101
|
"jest-environment-jsdom": "^30.2.0",
|
|
124
102
|
"jest-preview": "^0.3.1",
|
|
125
103
|
"mini-css-extract-plugin": "^2.9.1",
|
|
104
|
+
"playwright": "^1.60.0",
|
|
105
|
+
"postcss": "^8.4.47",
|
|
126
106
|
"postcss-loader": "^7.3.4",
|
|
127
107
|
"postcss-modules": "^6.0.0",
|
|
128
108
|
"react": "^18.3.1",
|
|
@@ -130,17 +110,31 @@
|
|
|
130
110
|
"react-is": "^18.3.1",
|
|
131
111
|
"sass": "^1.77.8",
|
|
132
112
|
"sass-loader": "^13.3.3",
|
|
133
|
-
"semantic-release": "^25.0.2",
|
|
134
113
|
"size-limit": "^11.2.0",
|
|
135
|
-
"storybook": "
|
|
114
|
+
"storybook": "10.4.2",
|
|
136
115
|
"ts-jest": "^29.4.6",
|
|
137
116
|
"tslib": "^2.8.1",
|
|
138
117
|
"tsup": "^8.0.0",
|
|
139
118
|
"typescript": "^5.9.3",
|
|
140
119
|
"url-loader": "^4.1.1",
|
|
141
|
-
"vite": "^
|
|
120
|
+
"vite": "^6.4.2",
|
|
121
|
+
"vitest": "^4.1.8",
|
|
142
122
|
"webpack": "^5.94.0",
|
|
143
123
|
"webpack-cli": "^5.1.4",
|
|
144
124
|
"webpack-fix-style-only-entries": "^0.6.1"
|
|
125
|
+
},
|
|
126
|
+
"scripts": {
|
|
127
|
+
"build": "cross-env IS_PUBLISHING=true tsup && cross-env IS_PUBLISHING=true webpack --config webpack.config.js && node scripts/create-cjs-shim.js",
|
|
128
|
+
"build-storybook": "storybook build",
|
|
129
|
+
"build-storybook-docs": "storybook build --docs",
|
|
130
|
+
"storybook-docs": "storybook dev --docs",
|
|
131
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
132
|
+
"lint-fix": "eslint src --ext .ts,.tsx --fix",
|
|
133
|
+
"size": "size-limit",
|
|
134
|
+
"start": "tsup --watch",
|
|
135
|
+
"storybook": "storybook dev -p 6006",
|
|
136
|
+
"test": "jest --passWithNoTests",
|
|
137
|
+
"test-watch": "jest --coverage --watch",
|
|
138
|
+
"chromatic": "chromatic --only-changed"
|
|
145
139
|
}
|
|
146
|
-
}
|
|
140
|
+
}
|
|
@@ -2,7 +2,7 @@ import { Calendar } from './Calendar';
|
|
|
2
2
|
|
|
3
3
|
import type { Meta } from '@storybook/react-vite';
|
|
4
4
|
import React, { useState, ChangeEvent } from 'react';
|
|
5
|
-
import { type DateRange } from 'react
|
|
5
|
+
import { type DateRange } from '@daypicker/react';
|
|
6
6
|
import { TextInput } from '../TextInput/TextInput';
|
|
7
7
|
import { format, isValid, parse } from 'date-fns';
|
|
8
8
|
|
|
@@ -76,7 +76,6 @@ describe('Calendar', () => {
|
|
|
76
76
|
/>
|
|
77
77
|
);
|
|
78
78
|
|
|
79
|
-
// In react-day-picker v9, we need to click the button inside the day cell
|
|
80
79
|
const dayButton = screen.getByRole('button', { name: /June 16th/i });
|
|
81
80
|
fireEvent.click(dayButton);
|
|
82
81
|
|
|
@@ -214,6 +213,13 @@ describe('Calendar', () => {
|
|
|
214
213
|
'--rdp-accent-color': 'var(--color-font-base)',
|
|
215
214
|
});
|
|
216
215
|
});
|
|
216
|
+
|
|
217
|
+
test('applies table width class to the month grid', () => {
|
|
218
|
+
const { container } = render(<Calendar />);
|
|
219
|
+
const monthGrid = container.querySelector('.rdp-month_grid');
|
|
220
|
+
|
|
221
|
+
expect(monthGrid).toHaveClass('w-100');
|
|
222
|
+
});
|
|
217
223
|
});
|
|
218
224
|
|
|
219
225
|
describe('Chevron icons', () => {
|
|
@@ -2,11 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import {
|
|
4
4
|
DayPicker,
|
|
5
|
-
DayPickerProps,
|
|
6
5
|
getDefaultClassNames,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type DayPickerProps,
|
|
7
|
+
type Matcher,
|
|
8
|
+
} from '@daypicker/react';
|
|
9
|
+
import '@daypicker/react/style.css';
|
|
10
10
|
import { Icon } from '../Icon/Icon';
|
|
11
11
|
|
|
12
12
|
export type CalendarProps = DayPickerProps;
|
|
@@ -74,11 +74,10 @@ function Calendar({
|
|
|
74
74
|
selected: classNames(
|
|
75
75
|
'font-color-inverse background-color-inverse hover:font-color-inverse'
|
|
76
76
|
),
|
|
77
|
-
month_grid: classNames(defaultClassNames.month_grid, 'm-top-lg'),
|
|
77
|
+
month_grid: classNames(defaultClassNames.month_grid, 'm-top-lg w-100'),
|
|
78
78
|
day: classNames(defaultClassNames.day, 'hover:font-color-base'),
|
|
79
79
|
day_button: classNames(defaultClassNames.day_button),
|
|
80
80
|
range_middle: classNames(defaultClassNames.range_middle),
|
|
81
|
-
table: classNames('w-100'),
|
|
82
81
|
dropdowns: classNames(defaultClassNames.dropdowns, 'h-100'),
|
|
83
82
|
caption_label: classNames(defaultClassNames.caption_label, 'g-2xs'),
|
|
84
83
|
}}
|
|
@@ -26,14 +26,14 @@ export interface HeadingProps {
|
|
|
26
26
|
className?: string;
|
|
27
27
|
/**
|
|
28
28
|
* A variant token identifier to use for the text variant. Available variants found:
|
|
29
|
-
* [here](https://github.com/
|
|
29
|
+
* [here](https://github.com/Hyphen/hyphen-components/blob/main/packages/design-tokens/tokens/color/font.json).
|
|
30
30
|
*/
|
|
31
31
|
color?: FontColor;
|
|
32
32
|
/**
|
|
33
33
|
* By default, size is determined by the chosen tag (e.g. h1 is bigger than h2).
|
|
34
34
|
* However, size can be set independently so that its size is appropriate for the surrounding content.
|
|
35
35
|
* Available sizes found:
|
|
36
|
-
* [here](https://github.com/
|
|
36
|
+
* [here](https://github.com/Hyphen/hyphen-components/blob/main/packages/design-tokens/tokens/size/font.json).
|
|
37
37
|
*/
|
|
38
38
|
size?: HeadingSize | ResponsiveProp<HeadingSize>;
|
|
39
39
|
/**
|
|
@@ -3,6 +3,7 @@ import classNames from 'classnames';
|
|
|
3
3
|
import Select, {
|
|
4
4
|
components,
|
|
5
5
|
ClearIndicatorProps,
|
|
6
|
+
GroupBase,
|
|
6
7
|
OptionsOrGroups,
|
|
7
8
|
OnChangeValue,
|
|
8
9
|
} from 'react-select';
|
|
@@ -16,7 +17,6 @@ import { Icon } from '../Icon/Icon';
|
|
|
16
17
|
import { FormLabel } from '../FormLabel/FormLabel';
|
|
17
18
|
import { InputValidationMessage } from '../InputValidationMessage/InputValidationMessage';
|
|
18
19
|
import styles from './SelectInput.module.scss';
|
|
19
|
-
import { GroupBase } from 'react-select/dist/declarations/src/types';
|
|
20
20
|
|
|
21
21
|
type SelectOption = {
|
|
22
22
|
value: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Meta } from '@storybook/react-vite';
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import { Table } from './Table';
|
|
4
4
|
import { Button } from '../Button/Button';
|
|
5
5
|
import { Badge } from '../Badge/Badge';
|
|
@@ -208,20 +208,16 @@ export const Sortable = () => {
|
|
|
208
208
|
return;
|
|
209
209
|
}
|
|
210
210
|
const newSortDirection = getNewSortDirection(sortedKey, sortedColumn);
|
|
211
|
+
const sortedData =
|
|
212
|
+
newSortDirection === 'ascending'
|
|
213
|
+
? sortAscending(tableData, sortedKey)
|
|
214
|
+
: sortDescending(tableData, sortedKey);
|
|
211
215
|
setSortedColumn({
|
|
212
216
|
dataKey: sortedKey,
|
|
213
217
|
sortDirection: newSortDirection,
|
|
214
218
|
});
|
|
219
|
+
setTableData(sortedData);
|
|
215
220
|
};
|
|
216
|
-
useEffect(() => {
|
|
217
|
-
if (sortedColumn.dataKey && sortedColumn.sortDirection) {
|
|
218
|
-
const sortedData =
|
|
219
|
-
sortedColumn.sortDirection === 'ascending'
|
|
220
|
-
? sortAscending(tableData, sortedColumn.dataKey)
|
|
221
|
-
: sortDescending(tableData, sortedColumn.dataKey);
|
|
222
|
-
setTableData(sortedData);
|
|
223
|
-
}
|
|
224
|
-
}, [sortedColumn, tableData]);
|
|
225
221
|
const columnConfig = [
|
|
226
222
|
{ heading: 'ID', dataKey: 'id', isSortable: true },
|
|
227
223
|
{ heading: 'Color', dataKey: 'color', isSortable: true },
|
|
@@ -276,20 +272,16 @@ export const SortablewithDefaultSortedColumn = () => {
|
|
|
276
272
|
return;
|
|
277
273
|
}
|
|
278
274
|
const newSortDirection = getNewSortDirection(sortedKey, sortedColumn);
|
|
275
|
+
const sortedData =
|
|
276
|
+
newSortDirection === 'ascending'
|
|
277
|
+
? sortAscending(tableData, sortedKey)
|
|
278
|
+
: sortDescending(tableData, sortedKey);
|
|
279
279
|
setSortedColumn({
|
|
280
280
|
dataKey: sortedKey,
|
|
281
281
|
sortDirection: newSortDirection,
|
|
282
282
|
});
|
|
283
|
+
setTableData(sortedData);
|
|
283
284
|
};
|
|
284
|
-
useEffect(() => {
|
|
285
|
-
if (sortedColumn.dataKey && sortedColumn.sortDirection) {
|
|
286
|
-
const sortedData =
|
|
287
|
-
sortedColumn.sortDirection === 'ascending'
|
|
288
|
-
? sortAscending(tableData, sortedColumn.dataKey)
|
|
289
|
-
: sortDescending(tableData, sortedColumn.dataKey);
|
|
290
|
-
setTableData(sortedData);
|
|
291
|
-
}
|
|
292
|
-
}, [sortedColumn, tableData]);
|
|
293
285
|
const columnConfig = [
|
|
294
286
|
{ heading: 'ID', dataKey: 'id', isSortable: true },
|
|
295
287
|
{ heading: 'Color', dataKey: 'color', isSortable: true },
|
|
@@ -336,20 +328,16 @@ export const SortableAndLoading = () => {
|
|
|
336
328
|
return;
|
|
337
329
|
}
|
|
338
330
|
const newSortDirection = getNewSortDirection(sortedKey, sortedColumn);
|
|
331
|
+
const sortedData =
|
|
332
|
+
newSortDirection === 'ascending'
|
|
333
|
+
? sortAscending(tableData, sortedKey)
|
|
334
|
+
: sortDescending(tableData, sortedKey);
|
|
339
335
|
setSortedColumn({
|
|
340
336
|
dataKey: sortedKey,
|
|
341
337
|
sortDirection: newSortDirection,
|
|
342
338
|
});
|
|
339
|
+
setTableData(sortedData);
|
|
343
340
|
};
|
|
344
|
-
useEffect(() => {
|
|
345
|
-
if (sortedColumn.dataKey && sortedColumn.sortDirection) {
|
|
346
|
-
const sortedData =
|
|
347
|
-
sortedColumn.sortDirection === 'ascending'
|
|
348
|
-
? sortAscending(tableData, sortedColumn.dataKey)
|
|
349
|
-
: sortDescending(tableData, sortedColumn.dataKey);
|
|
350
|
-
setTableData(sortedData);
|
|
351
|
-
}
|
|
352
|
-
}, [sortedColumn, tableData]);
|
|
353
341
|
const columnConfig = [
|
|
354
342
|
{ heading: 'ID', dataKey: 'id', isSortable: true },
|
|
355
343
|
{ heading: 'Color', dataKey: 'color', isSortable: true },
|
package/src/docs/Brands.mdx
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { Meta } from '@storybook/addon-docs/blocks';
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import logos from '@hyphen/hyphen-design-tokens/build/assets/images/react';
|
|
4
|
+
|
|
5
|
+
export const HyphenLogoHorizontalRgbPositive = logos['hyphen-logo-horizontal-rgb-positive'];
|
|
6
|
+
export const HyphenLogoHorizontalRgbNegative = logos['hyphen-logo-horizontal-rgb-negative'];
|
|
7
|
+
export const HyphenLogoHorizontalBlack = logos['hyphen-logo-horizontal-black'];
|
|
8
|
+
export const HyphenLogoHorizontalWhite = logos['hyphen-logo-horizontal-white'];
|
|
9
|
+
export const EnvLogoRgbPositive = logos['env-logo-rgb-positive'];
|
|
10
|
+
export const EnvLogoRgbNegative = logos['env-logo-rgb-negative'];
|
|
11
|
+
export const LinkLogoRgbPositive = logos['link-logo-rgb-positive'];
|
|
12
|
+
export const LinkLogoRgbNegative = logos['link-logo-rgb-negative'];
|
|
13
|
+
export const ToggleLogoHorizontalRgbPositive = logos['toggle-logo-horizontal-rgb-positive'];
|
|
14
|
+
export const ToggleLogoHorizontalRgbNegative = logos['toggle-logo-horizontal-rgb-negative'];
|
|
15
|
+
export const DeployLogoHorizontalPositive = logos['deploy-logo-horizontal-positive'];
|
|
16
|
+
export const DeployLogoHorizontalNegative = logos['deploy-logo-horizontal-negative'];
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
import { Box } from '../components/Box/Box';
|
|
@@ -13,7 +13,7 @@ We use [Style Dictionary](https://amzn.github.io/style-dictionary/) to generate
|
|
|
13
13
|
|
|
14
14
|
## Source on Github
|
|
15
15
|
|
|
16
|
-
[Hyphen Design Tokens](https://github.com/
|
|
16
|
+
[Hyphen Design Tokens](https://github.com/Hyphen/hyphen-components/tree/main/packages/design-tokens) are available as an [npm package](https://www.npmjs.com/package/@hyphen/hyphen-design-tokens) so that you can create a Hyphen unified product experience for your platform of choice.
|
|
17
17
|
|
|
18
18
|
## Border Radius
|
|
19
19
|
|
package/src/docs/GetStarted.mdx
CHANGED
package/src/docs/intro.mdx
CHANGED
|
@@ -7,6 +7,6 @@ import { Meta } from '@storybook/addon-docs/blocks';
|
|
|
7
7
|
Welcome to the Hyphen Design System, whose purpose is to help us deliver high quality Hyphen branded applications, faster and better. It consists of the following:
|
|
8
8
|
|
|
9
9
|
- [Hyphen Components](https://github.com/hyphen/hyphen-components) - an open source, react-based, component library for Hyphen applications and websites.
|
|
10
|
-
- [Hyphen Design Tokens](https://github.com/
|
|
10
|
+
- [Hyphen Design Tokens](https://github.com/Hyphen/hyphen-components/tree/main/packages/design-tokens) - A central location to store shared attributes of the Hyphen Design System. These include things like color, fonts, spacing, and more.
|
|
11
11
|
|
|
12
12
|
❤️ The Hyphen Team
|