@indico-data/design-system 2.45.2 → 2.45.4

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
@@ -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: `<type>(<optional ticket id>): <short summary>`
39
+ The title should have the following format: `<Tag>: <Short description>`
40
40
 
41
- The `<type>` should be `Fix`, `Update`, `New`, or `Breaking` for controlling releases.
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 `<type>` 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).
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(SNC-222): add dark mode`
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,31 @@ 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
+
112
+ 1. Have a `viewBox` attribute with `width` and `height` values;
113
+ - While not required, a `viewBox` of `"0 0 100 100"` means it will render consistently with other Indicons and Font Awesome icons.
114
+ - At a minimum, please ensure that the svg `path` reasonably fills the viewbox dimensions. Use an [SVG path editor](https://yqnn.github.io/svg-path-editor/) as needed.
115
+ 2. Have the `xmlns` and `fill` attributes set to `"http://www.w3.org/2000/svg"` and `"currentColor"` respectively.
116
+ 3. For monotone icons, one (1) `path` element with the `d` attribute set to a valid SVG path, **OR**
117
+ 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.
118
+
119
+ For monotone icons, the `currentColor` attribute of the SVG ensures that the color of the icons inherits from the parent element.
120
+
121
+ For duotone icons, the two `path`s should not be intersecting; aka, the secondary layer should be cut out of the primary one.
122
+
123
+ 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.
124
+
125
+ If an Indicon does not meet the requirements above, registration will fail.
126
+
127
+ ## Rectifying Badly-Sized Icons
128
+
129
+ As of January 7, 2025, we have observed inconsistencies in the sizing of certain icons within this design system. If you intend to use an icon and find that it appears improperly sized within its parent container, we recommend utilizing an [SVG path editor](https://yqnn.github.io/svg-path-editor/) to adjust and scale the path accordingly, ensuring it fully occupies the viewbox of the surrounding SVG.
130
+
106
131
  ## Theming Addon Documentation
107
132
 
108
133
  ### 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 | 2 | 3 | 4 | 5 | 6 | undefined;
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
- export { indicons };
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?: React.CSSProperties;
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?: React.CSSProperties;
175
+ style?: CSSProperties;
176
176
  onClick?: MouseEventHandler<SVGElement>;
177
177
  };
178
178