paris 0.8.17 → 0.8.18

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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # paris
2
2
 
3
+ ## 0.8.18
4
+
5
+ ### Patch Changes
6
+
7
+ - 3a29baf: Menu: update category
8
+ - e9d24cf: Icon: fix typings for `as` prop
9
+ - e9d24cf: StyledLink: fix typings for `as` prop
10
+ - 9b29f1d: Table: update docs to mention `cells` instead of `nodes` for `rowRenderFn`
11
+
3
12
  ## 0.8.17
4
13
 
5
14
  ### Patch Changes
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "paris",
3
3
  "author": "Sanil Chawla <sanil@slingshot.fm> (https://sanil.co)",
4
4
  "description": "Paris is Slingshot's React design system. It's a collection of reusable components, design tokens, and guidelines that help us build consistent, accessible, and performant user interfaces.",
5
- "version": "0.8.17",
5
+ "version": "0.8.18",
6
6
  "homepage": "https://paris.slingshot.fm",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef, NamedExoticComponent } from 'react';
1
+ import type { ComponentPropsWithoutRef, ElementType, NamedExoticComponent } from 'react';
2
2
  import { createElement, memo } from 'react';
3
3
 
4
4
  export type IconDefinitionProps = {
@@ -9,7 +9,7 @@ export type IconDefinitionProps = {
9
9
  };
10
10
  export type IconDefinition = NamedExoticComponent<IconDefinitionProps>;
11
11
 
12
- export type IconProps<T extends keyof JSX.IntrinsicElements = 'span'> = IconDefinitionProps & {
12
+ export type IconProps<T extends ElementType = 'span'> = IconDefinitionProps & {
13
13
  icon: IconDefinition;
14
14
  as?: T;
15
15
  overrides?: {
@@ -31,7 +31,7 @@ export type IconProps<T extends keyof JSX.IntrinsicElements = 'span'> = IconDefi
31
31
  * ```
32
32
  * @constructor
33
33
  */
34
- export const Icon = memo<IconProps>(({
34
+ export const Icon = memo<IconProps<ElementType>>(({
35
35
  as = 'span',
36
36
  icon,
37
37
  size,
@@ -6,7 +6,7 @@ import { Button } from '../button';
6
6
  import { ChevronRight, Ellipsis } from '../icon';
7
7
 
8
8
  const meta: Meta<typeof Menu> = {
9
- title: 'Uncategorized/Menu',
9
+ title: 'Surfaces/Menu',
10
10
  component: Menu,
11
11
  tags: ['autodocs'],
12
12
  };
@@ -12,12 +12,17 @@ type Story = StoryObj<typeof StyledLink>;
12
12
 
13
13
  export const Default: Story = {
14
14
  args: {
15
- children: 'Hello world! This is a new StyledLink component.',
15
+ href: 'https://slingshot.fm',
16
+ target: '_blank',
17
+ children: 'Hello world! This is a styled link.',
16
18
  },
17
19
  };
18
20
 
19
- export const Secondary: Story = {
21
+ export const AsButton: Story = {
20
22
  args: {
21
- children: 'Hello world! This is a secondary component.',
23
+ as: 'button',
24
+ // eslint-disable-next-line no-alert
25
+ onClick: () => alert('Hello world!'),
26
+ children: 'Hello world! This is a StyledLink rendered as a button.',
22
27
  },
23
28
  };
@@ -24,7 +24,7 @@ export type StyledLinkProps<T extends ElementType = 'a'> = {
24
24
  * ```
25
25
  * @constructor
26
26
  */
27
- export const StyledLink: FC<StyledLinkProps> = ({
27
+ export const StyledLink: FC<StyledLinkProps<ElementType>> = ({
28
28
  as = 'a',
29
29
  children,
30
30
  className,
@@ -42,7 +42,7 @@ export type TableProps<
42
42
  *
43
43
  * The function should return an object containing a property named `key` for the row's React key (should be a unique id), and a property named `nodes` containing an array of React nodes to be rendered as cells in the row.
44
44
  * @param row - The data for the row being rendered.
45
- * @returns An object containing a property named `key` for the row's React key (should be a unique id), and a property named `nodes` containing an array of React nodes to be rendered as cells in the row.
45
+ * @returns An object containing a property named `key` for the row's React key (should be a unique id), and a property named `cells` containing an array of React nodes to be rendered as cells in the row.
46
46
  * @see RowRenderData
47
47
  */
48
48
  rowRenderFn?: (row: RowData[number]) => RowRenderData;