@kystverket/styrbord 1.20.0 → 1.20.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.
@@ -1,6 +1,26 @@
1
1
  import { ButtonProps as DsButtonProps } from '@digdir/designsystemet-react';
2
2
  import { FC } from 'react';
3
3
  export type ButtonProps = {
4
+ /**
5
+ * Visual style of the button.
6
+ *
7
+ * Styrbord deliberately and permanently names these differently from Designsystemet. The
8
+ * upstream names (`primary`/`secondary`/`tertiary`) read as emphasis levels and collide with
9
+ * `data-color="primary"`, which is a colour family — two unrelated things spelled the same way.
10
+ * Styrbord names the shape instead, which also leaves room for `subtle` and `dashed`, neither of
11
+ * which Designsystemet has.
12
+ *
13
+ * | Styrbord | Designsystemet |
14
+ * | ----------- | ---------------------- |
15
+ * | `filled` | `primary` |
16
+ * | `outline` | `secondary` |
17
+ * | `ghost` | `tertiary` |
18
+ * | `subtle` | `primary` + extra CSS |
19
+ * | `dashed` | `secondary` + extra CSS|
20
+ *
21
+ * Consequence of the divergence: the upstream `variant` prop is not forwarded, so Designsystemet
22
+ * examples need translating through the table above. Use this list, not theirs.
23
+ */
4
24
  variant?: 'filled' | 'subtle' | 'outline' | 'ghost' | 'dashed';
5
25
  color?: 'primary' | 'neutral' | 'danger';
6
26
  size?: 'sm' | 'md' | 'lg';
@@ -26,6 +26,7 @@ export default meta;
26
26
  type Story = StoryObj<typeof meta>;
27
27
  export declare const Default: Story;
28
28
  export declare const Disabled: Story;
29
+ export declare const WithCodeFormatting: Story;
29
30
  export declare const WithError: Story;
30
31
  export declare const WithBottomToolbar: Story;
31
32
  /**
package/dist/style.js CHANGED
@@ -3511,7 +3511,7 @@ const x = ({
3511
3511
  };
3512
3512
  }, f3 = (A) => A.replaceAll(/<br\s*\/?>/gi, `
3513
3513
 
3514
- `), GA = /* @__PURE__ */ new Set(["CodeBlock", "InlineCode", "Blockquote", "Hr", "Html"]), TA = U7.filter((A) => {
3514
+ `), GA = /* @__PURE__ */ new Set(["Blockquote", "Hr", "Html"]), TA = U7.filter((A) => {
3515
3515
  var I;
3516
3516
  const t = ((I = A.meta) == null ? void 0 : I.group) ?? "";
3517
3517
  return !GA.has(t);