@indico-data/design-system 2.45.2 → 2.45.3
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 +23 -4
- package/lib/components/forms/date/datePicker/contants.d.ts +1 -1
- package/lib/components/icons/Icon.stories.d.ts +1 -0
- package/lib/components/icons/indicons.d.ts +3 -1
- package/lib/components/icons/types.d.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.esm.js +208 -164
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +206 -162
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/button/Button.stories.tsx +5 -0
- package/src/components/icons/Icon.mdx +26 -5
- package/src/components/icons/Icon.stories.tsx +21 -3
- package/src/components/icons/Icon.tsx +10 -14
- package/src/components/icons/__tests__/Icon.test.tsx +8 -8
- package/src/components/icons/indicons.tsx +296 -351
- package/src/components/icons/types.ts +2 -2
- package/src/setup/setupIcons.ts +5 -1
- package/src/storybook/iconNames.ts +1 -1
package/README.md
CHANGED
|
@@ -36,16 +36,16 @@ This repository follows a slightly modified version of the [ESLint Commit Messag
|
|
|
36
36
|
|
|
37
37
|
### Title
|
|
38
38
|
|
|
39
|
-
The title should have the following format: `<
|
|
39
|
+
The title should have the following format: `<Tag>: <Short description>`
|
|
40
40
|
|
|
41
|
-
The `<
|
|
41
|
+
The `<Tag>` should be `Fix`, `Update`, `New`, or `Breaking` for controlling releases.
|
|
42
42
|
|
|
43
|
-
If the PR need not be associated with a new release, choose any other `<
|
|
43
|
+
If the PR need not be associated with a new release, choose any other `<Tag>` from the [ESLint commit convention tags](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint#eslint-convention), such as `Docs` (documentation), `Build` (build process), `Upgrade` (dependency upgrade), or `Chore` (non-user-facing tasks).
|
|
44
44
|
|
|
45
45
|
Examples:
|
|
46
46
|
|
|
47
47
|
- `Update: button color adjustment`
|
|
48
|
-
- `New
|
|
48
|
+
- `New: [SNC-222] add dark mode`
|
|
49
49
|
|
|
50
50
|
If your PR title does not follow these commit conventions, merging will be blocked.
|
|
51
51
|
|
|
@@ -103,6 +103,25 @@ Do NOT use the `version` attribute of `package.json` to track or initiate releas
|
|
|
103
103
|
|
|
104
104
|
Do not manually release Permafrost to npm, as it may cause issues with the Semantic Release pipeline.
|
|
105
105
|
|
|
106
|
+
## Adding New Indicons
|
|
107
|
+
|
|
108
|
+
We support registering custom SVG icons (indicons) alongside the ones provided by Font Awesome. To add a new icon, add its SVG to the `indicons` object in `src/components/icons/indicons.ts`.
|
|
109
|
+
|
|
110
|
+
Not all SVGs can be valid Font Awesome icons. All custom SVGs must:
|
|
111
|
+
1. Have a `viewBox` attribute with `width` and `height` values;
|
|
112
|
+
- While not required, a `viewBox` of `"0 0 100 100"` means it will render consistently with other Indicons and Font Awesome icons.
|
|
113
|
+
2. Have the `xmlns` and `fill` attributes set to `"http://www.w3.org/2000/svg"` and `"currentColor"` respectively.
|
|
114
|
+
3. For monotone icons, one (1) `path` element with the `d` attribute set to a valid SVG path, **OR**
|
|
115
|
+
4. For duotone icons, two (2) `path` elements each with a `d` attribute, and where the "bottom" / primary layer is has an opacity of `"1.0"` and the "top" / secondary layer has an opacity of `"0.4"`. Opacity is just the method by which Font Awesome distinguishs between layers internally; the styling is meant to be overriden through the custom CSS.
|
|
116
|
+
|
|
117
|
+
For monotone icons, the `currentColor` attribute of the SVG ensures that the color of the icons inherits from the parent element.
|
|
118
|
+
|
|
119
|
+
For duotone icons, the two `path`s should not be intersecting; aka, the secondary layer should be cut out of the primary one.
|
|
120
|
+
|
|
121
|
+
To ease with meeting those requirements, we recommended passing exported SVGs through an optimizer like [svgo](https://svgomg.net/) to merge paths and remove unnecessary attributes (enabling every option except `Remove xmlns`, with a `Precision` of `2` usually results in an identical but cleaner SVG). [SVG Editor Online](https://freesvgeditor.com/en/svg-editor-online) is another good option for deleting nodes, paths, and general editing.
|
|
122
|
+
|
|
123
|
+
If an Indicon does not meet the requirements above, registration will fail.
|
|
124
|
+
|
|
106
125
|
## Theming Addon Documentation
|
|
107
126
|
|
|
108
127
|
### Addon - Themes
|
|
@@ -10,7 +10,7 @@ export declare const getCommonProps: (props: CommonProps) => {
|
|
|
10
10
|
components: Partial<import("react-day-picker").CustomComponents> | undefined;
|
|
11
11
|
isDisabled: import("react-day-picker").Matcher | import("react-day-picker").Matcher[] | undefined;
|
|
12
12
|
formatters: Partial<import("react-day-picker").Formatters> | undefined;
|
|
13
|
-
weekStartsOn: 0 | 1 |
|
|
13
|
+
weekStartsOn: 0 | 2 | 1 | 5 | 3 | 4 | 6 | undefined;
|
|
14
14
|
firstWeekContainsDate: 1 | 4 | undefined;
|
|
15
15
|
today: Date | undefined;
|
|
16
16
|
required: any;
|
|
@@ -6,5 +6,6 @@ type Story = StoryObj<IconProps>;
|
|
|
6
6
|
export declare const DefaultIcon: Story;
|
|
7
7
|
export declare const IconStates: Story;
|
|
8
8
|
export declare const CustomStyledIcon: Story;
|
|
9
|
+
export declare const DuotoneIconStory: Story;
|
|
9
10
|
export declare const Indicons: Story;
|
|
10
11
|
export declare const FontAwesomeIcons: Story;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
|
|
1
2
|
declare const indicons: {
|
|
2
3
|
'indico-o-white': import("react/jsx-runtime").JSX.Element;
|
|
3
4
|
account: import("react/jsx-runtime").JSX.Element;
|
|
@@ -152,4 +153,5 @@ declare const indicons: {
|
|
|
152
153
|
'zoom-in': import("react/jsx-runtime").JSX.Element;
|
|
153
154
|
'zoom-out': import("react/jsx-runtime").JSX.Element;
|
|
154
155
|
};
|
|
155
|
-
|
|
156
|
+
declare const indiconDefinitions: IconDefinition[];
|
|
157
|
+
export { indicons, indiconDefinitions };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MouseEventHandler } from 'react';
|
|
1
|
+
import { MouseEventHandler, CSSProperties } from 'react';
|
|
2
2
|
import { PermafrostComponent } from '../../types';
|
|
3
3
|
import { IconName as FAIconName } from '@fortawesome/fontawesome-svg-core';
|
|
4
4
|
import { indicons } from './indicons';
|
|
@@ -9,6 +9,6 @@ export type IconProps = PermafrostComponent & {
|
|
|
9
9
|
name: IconName;
|
|
10
10
|
ariaLabel?: string;
|
|
11
11
|
size?: IconSizes;
|
|
12
|
-
style?:
|
|
12
|
+
style?: CSSProperties;
|
|
13
13
|
onClick?: MouseEventHandler<SVGElement>;
|
|
14
14
|
};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IconDefinition, IconName as IconName$1 } from '@fortawesome/fontawesome-svg-core';
|
|
2
2
|
import { UseFloatingOptions } from '@floating-ui/react-dom';
|
|
3
3
|
export * from '@floating-ui/react-dom';
|
|
4
|
-
import React$1, { MouseEventHandler, ReactElement } from 'react';
|
|
4
|
+
import React$1, { CSSProperties, MouseEventHandler, ReactElement } from 'react';
|
|
5
5
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
6
|
import { ContainerProps, RowProps, ColProps } from 'react-grid-system';
|
|
7
7
|
import { TableProps as TableProps$1, Direction as Direction$1, Alignment as Alignment$1 } from 'react-data-table-component';
|
|
@@ -172,7 +172,7 @@ type IconProps = PermafrostComponent & {
|
|
|
172
172
|
name: IconName;
|
|
173
173
|
ariaLabel?: string;
|
|
174
174
|
size?: IconSizes;
|
|
175
|
-
style?:
|
|
175
|
+
style?: CSSProperties;
|
|
176
176
|
onClick?: MouseEventHandler<SVGElement>;
|
|
177
177
|
};
|
|
178
178
|
|