@theroutingcompany/components 0.0.24-alpha.3 → 0.0.24-alpha.5
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 +9 -7
- package/dist/trc-components.es.js +9 -10
- package/dist/trc-components.es.js.map +1 -1
- package/dist/trc-components.umd.js +6 -4
- package/dist/trc-components.umd.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/types/components/Drawer/Drawer.d.ts +3 -3
package/README.md
CHANGED
|
@@ -4,14 +4,15 @@ View the [StoryBook](https://6392297e45ccab79e466ee19-iytnzjepcr.chromatic.com/)
|
|
|
4
4
|
|
|
5
5
|
## Publishing
|
|
6
6
|
|
|
7
|
-
First double check if everything that needs to exported is added to the `components/index.js` or `helpers/index.js
|
|
7
|
+
First double check if everything that needs to exported is added to the `components/index.js` or `helpers/index.js` and run `npm run build` before.
|
|
8
8
|
|
|
9
9
|
### Public
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
2. `npm
|
|
11
|
+
0. Get an approval on the relevant PR.
|
|
12
|
+
2. Bump version number `npm version patch --no-git-tag-version`
|
|
13
|
+
3. `npm publish --access public`.
|
|
13
14
|
* Usually adding `--dry-run` first is a good idea for double checking if the version number is correct.
|
|
14
|
-
|
|
15
|
+
4. Enter the 2FA code for npm
|
|
15
16
|
|
|
16
17
|
### Prerelease
|
|
17
18
|
|
|
@@ -38,7 +39,7 @@ Styling is done with [styled-components](https://styled-components.com/), a CSS-
|
|
|
38
39
|
The approach is roughly:
|
|
39
40
|
|
|
40
41
|
1. A "base" styled component with shared styles: `ButtonBase`
|
|
41
|
-
2. Each variant in the Figma designs is a styled component 'extending' the base component: ` const PrimaryButton = styled(ButtonBase)
|
|
42
|
+
2. Each variant in the Figma designs is a styled component 'extending' the base component: ` const PrimaryButton = styled(ButtonBase)`
|
|
42
43
|
|
|
43
44
|
- All variant are placed in an object (a map but not a `Map()`)
|
|
44
45
|
- The exported takes a `variant` prop and uses it to get the right styled component from the object map
|
|
@@ -47,7 +48,6 @@ The approach is roughly:
|
|
|
47
48
|
|
|
48
49
|
This component library is very much a work in progress and has many gaps.
|
|
49
50
|
|
|
50
|
-
- A component that exposes the spacing design tokens in an easy-to-use, type-safe way. Usually this is called `Box`.
|
|
51
51
|
- Far from all components in the Components Figma have been implemented
|
|
52
52
|
- For existing component, we need more documentation. Often, design systems include a "Guidelines" or "When to Use" section" on the component doc page.
|
|
53
53
|
- Tests!
|
|
@@ -134,7 +134,9 @@ Also see [Most of the time, it’s a good idea to use React context for componen
|
|
|
134
134
|
The context should only be consumed within the library component and not exported.
|
|
135
135
|
|
|
136
136
|
<figure>
|
|
137
|
-
>
|
|
137
|
+
<blockquote>
|
|
138
|
+
[T]he context should be kept internal to the library. Allowing the naked context to be imported and handled by applications creates a brittle coupling that will easily break in future upgrades.
|
|
139
|
+
</blockquote>
|
|
138
140
|
<figcaption>
|
|
139
141
|
<cite>
|
|
140
142
|
<a href="https://www.gabe.pizza/notes-on-component-libraries/#most-of-the-time-its-a-good-idea-to-use-react-context-for-components-that-depend-on-each-other">Notes on maintaining an internal React component library
|
|
@@ -10789,7 +10789,6 @@ const a3 = Rb, i3 = Q7, s3 = t3, l3 = r3, c3 = o3, d3 = Me`
|
|
|
10789
10789
|
`, TA = () => /* @__PURE__ */ S(ro, { asChild: !0, children: /* @__PURE__ */ S(Yn, { label: "Close drawer", variant: "inverse", children: /* @__PURE__ */ S(lp, {}) }) }), f3 = A(jl)`
|
|
10790
10790
|
width: var(--drawer-width);
|
|
10791
10791
|
z-index: 3;
|
|
10792
|
-
width: 540px;
|
|
10793
10792
|
background-color: white;
|
|
10794
10793
|
padding: 24px;
|
|
10795
10794
|
margin: 16px;
|
|
@@ -10799,7 +10798,7 @@ const a3 = Rb, i3 = Q7, s3 = t3, l3 = r3, c3 = o3, d3 = Me`
|
|
|
10799
10798
|
box-shadow: ${m.elevation_static_high};
|
|
10800
10799
|
border-radius: ${m.border_radius_800};
|
|
10801
10800
|
scrollbar-gutter: stable;
|
|
10802
|
-
overflow:
|
|
10801
|
+
overflow-y: auto;
|
|
10803
10802
|
|
|
10804
10803
|
@media (prefers-reduced-motion: no-preference) {
|
|
10805
10804
|
&[data-state='open'] {
|
|
@@ -10811,6 +10810,8 @@ const a3 = Rb, i3 = Q7, s3 = t3, l3 = r3, c3 = o3, d3 = Me`
|
|
|
10811
10810
|
}
|
|
10812
10811
|
}
|
|
10813
10812
|
`, CA = A(Ul)`
|
|
10813
|
+
display: flex;
|
|
10814
|
+
column-gap: ${m.spacing_200};
|
|
10814
10815
|
font-family: ${m.font_family_sans};
|
|
10815
10816
|
font-size: ${m.font_size_100};
|
|
10816
10817
|
font-style: normal;
|
|
@@ -10831,14 +10832,11 @@ const a3 = Rb, i3 = Q7, s3 = t3, l3 = r3, c3 = o3, d3 = Me`
|
|
|
10831
10832
|
medium: 540,
|
|
10832
10833
|
large: 900
|
|
10833
10834
|
};
|
|
10834
|
-
function RA({ children: e, size: t = "medium" }) {
|
|
10835
|
-
const
|
|
10836
|
-
return /* @__PURE__ */ S(Vl, { style: { "--drawer-width":
|
|
10835
|
+
function RA({ children: e, size: t = "medium", ...r }) {
|
|
10836
|
+
const n = m3[t];
|
|
10837
|
+
return /* @__PURE__ */ S(Vl, { ...r, style: { "--drawer-width": n }, children: /* @__PURE__ */ S(f3, { onInteractOutside: (o) => o.preventDefault(), children: e }) });
|
|
10837
10838
|
}
|
|
10838
|
-
const IA = (
|
|
10839
|
-
children: e,
|
|
10840
|
-
...t
|
|
10841
|
-
}) => /* @__PURE__ */ S(a3, { ...t, children: e }), AA = A(i3)`
|
|
10839
|
+
const IA = a3, AA = A(i3)`
|
|
10842
10840
|
padding-top: 12px;
|
|
10843
10841
|
border-bottom: 1px solid ${m.color_divider_standard};
|
|
10844
10842
|
|
|
@@ -10859,7 +10857,8 @@ const IA = ({
|
|
|
10859
10857
|
padding: 10px;
|
|
10860
10858
|
line-height: 0;
|
|
10861
10859
|
|
|
10862
|
-
transition: background-color 200ms ease-out,
|
|
10860
|
+
transition: background-color 200ms ease-out,
|
|
10861
|
+
transform 300ms cubic-bezier(0.87, 0, 0.13, 1);
|
|
10863
10862
|
|
|
10864
10863
|
box-shadow: var(--icon-elevation, none);
|
|
10865
10864
|
background: var(
|