-
+
);
};
@@ -44,13 +37,13 @@ export const HeaderRow = ({ children }: { children: React.ReactNode }) => {
};
export const HeaderCell = ({ children }: { children: React.ReactNode }) => {
- return
{children} | ;
+ return
{children} | ;
};
export const Row = ({ children }: { children: React.ReactNode }) => {
- return
{children}
;
+ return
{children}
;
};
export const Cell = ({ children }: { children: React.ReactNode }) => {
- return
{children} | ;
+ return
{children} | ;
};
diff --git a/packages/canon/docs/components/Table/index.ts b/packages/canon/docs/components/Table/index.ts
new file mode 100644
index 0000000000..7419aa83a8
--- /dev/null
+++ b/packages/canon/docs/components/Table/index.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2024 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export { Root, Header, Body, Row, Cell, HeaderRow, HeaderCell } from './Table';
diff --git a/packages/canon/docs/components/Table/styles.css b/packages/canon/docs/components/Table/styles.css
new file mode 100644
index 0000000000..a8c35d3978
--- /dev/null
+++ b/packages/canon/docs/components/Table/styles.css
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2024 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+.table-wrapper {
+ border: 1px solid #e7e7e7;
+ border-radius: 4px;
+ overflow: hidden;
+
+ & .table {
+ width: 100%;
+ margin: 0 !important;
+ padding: 0 !important;
+ border-spacing: 0px;
+ border-collapse: collapse;
+ }
+
+ & .table-cell {
+ padding: 12px 16px !important;
+ border: none !important;
+ text-align: left;
+ background-color: white !important;
+ font-family: 'Geist', sans-serif;
+ font-size: 16px;
+ font-weight: 300;
+
+ & p {
+ margin: 0;
+ }
+ }
+
+ & .table-header-cell {
+ background-color: #f5f5f5 !important;
+ border-bottom: 1px solid #e7e7e7 !important;
+ font-weight: 500;
+ font-size: 14px;
+ }
+
+ & .table-row {
+ border: none;
+ border-bottom: 1px solid #e7e7e7;
+ &:last-child {
+ border-bottom: none;
+ }
+ }
+
+ & .table-chip {
+ display: inline-block;
+ font-size: 14px !important;
+ border: 1px solid #e7e7e7;
+ border-radius: 6px;
+ padding: 0px 6px;
+ height: 24px;
+ }
+
+ & .table-type {
+ display: flex;
+ flex-wrap: wrap;
+ flex-direction: row;
+ gap: 8px;
+ }
+}
diff --git a/packages/canon/docs/components/Table/table.css.ts b/packages/canon/docs/components/Table/table.css.ts
deleted file mode 100644
index b01373ee04..0000000000
--- a/packages/canon/docs/components/Table/table.css.ts
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright 2024 The Backstage Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { style, globalStyle } from '@vanilla-extract/css';
-
-export const wrapperStyles = style({
- border: '1px solid #e7e7e7',
- borderRadius: '4px',
- overflow: 'hidden',
-});
-
-export const tableStyles = style({
- width: '100%',
- margin: '0 !important',
- padding: '0 !important',
- borderSpacing: '0px',
- borderCollapse: 'collapse',
-});
-
-export const cellStyles = style({
- padding: '12px 16px !important',
- border: 'none !important',
- textAlign: 'left',
- backgroundColor: 'white !important',
- fontFamily: '"Geist", sans-serif',
- fontSize: '16px',
- fontWeight: 300,
-});
-
-// Apply global styles to
elements inside cellStyles
-globalStyle(`${cellStyles} p`, {
- margin: '0',
-});
-
-export const headerRowStyles = style({
- borderBottom: '1px solid #e7e7e7',
-});
-
-export const headerCellStyles = style({
- backgroundColor: '#f5f5f5 !important',
- borderBottom: '1px solid #e7e7e7 !important',
- fontWeight: 500,
- fontSize: '14px',
-});
-
-export const rowStyles = style({
- border: 'none',
- borderBottom: '1px solid #e7e7e7',
- selectors: {
- '&:last-child': {
- borderBottom: 'none',
- },
- },
-});
-
-export const chipStyles = style({
- display: 'inline-block',
- fontSize: '14px !important',
- border: '1px solid #e7e7e7',
- borderRadius: '6px',
- padding: '0px 6px',
- height: '24px',
-});
-
-export const typeStyles = style({
- display: 'flex',
- flexWrap: 'wrap',
- flexDirection: 'row',
- gap: '8px',
-});
diff --git a/packages/canon/docs/components/Text/index.tsx b/packages/canon/docs/components/Text/Text.tsx
similarity index 90%
rename from packages/canon/docs/components/Text/index.tsx
rename to packages/canon/docs/components/Text/Text.tsx
index be882c0a81..9f3dd6ce90 100644
--- a/packages/canon/docs/components/Text/index.tsx
+++ b/packages/canon/docs/components/Text/Text.tsx
@@ -15,7 +15,6 @@
*/
import React from 'react';
-import { textStyles } from './text.css';
export const Text = ({
children,
@@ -25,7 +24,7 @@ export const Text = ({
style?: React.CSSProperties;
}) => {
return (
-
+
{children}
);
diff --git a/packages/canon/docs/components/Text/index.ts b/packages/canon/docs/components/Text/index.ts
new file mode 100644
index 0000000000..873fca2c76
--- /dev/null
+++ b/packages/canon/docs/components/Text/index.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2024 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export { Text } from './Text';
diff --git a/packages/canon/docs/components/Text/styles.css b/packages/canon/docs/components/Text/styles.css
new file mode 100644
index 0000000000..cbb2b88edb
--- /dev/null
+++ b/packages/canon/docs/components/Text/styles.css
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2024 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+.text {
+ font-family: 'Geist', sans-serif;
+ font-size: 16px;
+ line-height: 28px;
+ margin: 0;
+ font-weight: 300;
+ margin-bottom: 16px;
+
+ & p {
+ font-family: 'Geist', sans-serif;
+ font-size: 16px;
+ line-height: 28px;
+ margin: 0;
+ font-weight: 300;
+ }
+}
diff --git a/packages/canon/docs/components/Title/index.tsx b/packages/canon/docs/components/Title/Title.tsx
similarity index 92%
rename from packages/canon/docs/components/Title/index.tsx
rename to packages/canon/docs/components/Title/Title.tsx
index 13e5b964bb..056ccfc14d 100644
--- a/packages/canon/docs/components/Title/index.tsx
+++ b/packages/canon/docs/components/Title/Title.tsx
@@ -15,7 +15,6 @@
*/
import React from 'react';
-import { titleStyles } from './title.css';
export const Title = ({
children,
@@ -32,7 +31,7 @@ export const Title = ({
if (type === 'h3') Component = 'h3';
return React.createElement(Component, {
- className: titleStyles({ type }),
+ className: `title ${type}`,
style,
children,
});
diff --git a/packages/canon/docs/components/Title/index.ts b/packages/canon/docs/components/Title/index.ts
new file mode 100644
index 0000000000..998dc81882
--- /dev/null
+++ b/packages/canon/docs/components/Title/index.ts
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2024 The Backstage Authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+export { Title } from './Title';
diff --git a/packages/canon/docs/components/Text/text.css.ts b/packages/canon/docs/components/Title/styles.css
similarity index 59%
rename from packages/canon/docs/components/Text/text.css.ts
rename to packages/canon/docs/components/Title/styles.css
index fbbc427362..a8d00e2af5 100644
--- a/packages/canon/docs/components/Text/text.css.ts
+++ b/packages/canon/docs/components/Title/styles.css
@@ -14,21 +14,30 @@
* limitations under the License.
*/
-import { globalStyle, style } from '@vanilla-extract/css';
+.title {
+ font-family: 'Geist', sans-serif;
+ margin: 0;
+ font-weight: 500;
+ border: none;
-export const textStyles = style({
- fontFamily: '"Geist", sans-serif',
- fontSize: '16px',
- lineHeight: '28px',
- margin: '0',
- fontWeight: 300,
- marginBottom: '16px',
-});
+ &.h1 {
+ font-size: 36px;
+ line-height: 44px;
+ margin-bottom: 8px;
+ margin-top: 0px;
+ }
-globalStyle(`${textStyles} p`, {
- fontFamily: '"Geist", sans-serif',
- fontSize: '16px',
- lineHeight: '28px',
- margin: '0',
- fontWeight: 300,
-});
+ &.h2 {
+ font-size: 24px;
+ line-height: 32px;
+ margin-bottom: 12px;
+ margin-top: 52px;
+ }
+
+ &.h3 {
+ font-size: 20px;
+ line-height: 28px;
+ margin-bottom: 12px;
+ margin-top: 40px;
+ }
+}
diff --git a/packages/canon/docs/components/Title/title.css.ts b/packages/canon/docs/components/Title/title.css.ts
deleted file mode 100644
index 6618ad80be..0000000000
--- a/packages/canon/docs/components/Title/title.css.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright 2024 The Backstage Authors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { recipe } from '@vanilla-extract/recipes';
-
-export const titleStyles = recipe({
- base: {
- fontFamily: '"Geist", sans-serif',
- margin: '0',
- fontWeight: 500,
- border: 'none',
- },
- variants: {
- type: {
- h1: {
- fontSize: '36px',
- lineHeight: '44px',
- marginBottom: '8px',
- marginTop: '0px',
- },
- h2: {
- fontSize: '24px',
- lineHeight: '32px',
- marginBottom: '12px',
- marginTop: '52px',
- },
- h3: {
- fontSize: '20px',
- lineHeight: '28px',
- marginBottom: '12px',
- marginTop: '40px',
- },
- },
- },
-});
diff --git a/packages/canon/docs/components/index.ts b/packages/canon/docs/components/index.ts
index 7ad07bec6a..0e5ff2e325 100644
--- a/packages/canon/docs/components/index.ts
+++ b/packages/canon/docs/components/index.ts
@@ -14,13 +14,14 @@
* limitations under the License.
*/
+export * from './Banner';
export * from './Chip';
-export * from './Table';
-export * from './Title';
-export * from './Text';
export * from './Columns';
export * from './ComponentStatus';
-export * from './LayoutComponents';
-export * from './Banner';
export * from './IconLibrary';
+export * from './LayoutComponents';
+export * from './PropsTable';
export * from './Roadmap';
+export * from './Table';
+export * from './Text';
+export * from './Title';
diff --git a/packages/canon/docs/components/styles.css b/packages/canon/docs/components/styles.css
index 698085ad19..670b0c3046 100644
--- a/packages/canon/docs/components/styles.css
+++ b/packages/canon/docs/components/styles.css
@@ -1,2 +1,10 @@
+@import './Banner/styles.css';
+@import './Chip/styles.css';
+@import './Columns/styles.css';
+@import './ComponentStatus/styles.css';
@import './IconLibrary/styles.css';
+@import './LayoutComponents/styles.css';
@import './Roadmap/styles.css';
+@import './Table/styles.css';
+@import './Text/styles.css';
+@import './Title/styles.css';
diff --git a/packages/canon/package.json b/packages/canon/package.json
index c8a8f79a6f..7bfc717b74 100644
--- a/packages/canon/package.json
+++ b/packages/canon/package.json
@@ -39,9 +39,6 @@
"dependencies": {
"@base_ui/react": "^1.0.0-alpha.3",
"@remixicon/react": "^4.5.0",
- "@vanilla-extract/css": "^1.16.0",
- "@vanilla-extract/dynamic": "^2.1.2",
- "@vanilla-extract/recipes": "^0.5.5",
"@vanilla-extract/sprinkles": "^1.6.3"
},
"devDependencies": {
diff --git a/packages/canon/src/components/Box/Box.tsx b/packages/canon/src/components/Box/Box.tsx
index a470c0584d..ecf138f1ce 100644
--- a/packages/canon/src/components/Box/Box.tsx
+++ b/packages/canon/src/components/Box/Box.tsx
@@ -16,7 +16,6 @@
import { createElement, forwardRef } from 'react';
import { boxSprinkles } from './sprinkles.css';
-import { base } from './box.css';
import { BoxProps } from './types';
/** @public */
@@ -27,7 +26,7 @@ export const Box = forwardRef
((props, ref) => {
const sprinklesClassName = boxSprinkles(restProps);
// Combine the base class name, the sprinkles class name, and any additional class names
- const classNames = [base, sprinklesClassName, className]
+ const classNames = ['box', sprinklesClassName, className]
.filter(Boolean)
.join(' ');
diff --git a/packages/canon/src/components/Box/Docs.mdx b/packages/canon/src/components/Box/Docs.mdx
index 11cc53b148..a03c6d43d3 100644
--- a/packages/canon/src/components/Box/Docs.mdx
+++ b/packages/canon/src/components/Box/Docs.mdx
@@ -2,7 +2,7 @@ import { Meta, Unstyled, Source } from '@storybook/blocks';
import * as BoxStories from './Box.stories';
import { Title, Text } from '../../../docs/components';
import { Padding } from './docs/padding';
-import { PropsTable, getBoxProps } from '../../../docs/components/PropsTable';
+import { PropsTable, getProps } from '../../../docs/components';
import { boxProperties } from './sprinkles.css';
import { spacingProperties } from '../../layout/sprinkles.css';
@@ -29,7 +29,7 @@ import { spacingProperties } from '../../layout/sprinkles.css';
-
+
Examples
Here are some examples of how you can use the Box component.
diff --git a/packages/canon/src/components/Box/styles.css b/packages/canon/src/components/Box/styles.css
new file mode 100644
index 0000000000..75fd0dd493
--- /dev/null
+++ b/packages/canon/src/components/Box/styles.css
@@ -0,0 +1,4 @@
+.box {
+ font-family: 'var(--canon-font-regular)';
+ color: 'var(--canon-text-primary)';
+}
diff --git a/packages/canon/src/components/Button/Docs.mdx b/packages/canon/src/components/Button/Docs.mdx
index 7fa1886a4e..4ddce0c982 100644
--- a/packages/canon/src/components/Button/Docs.mdx
+++ b/packages/canon/src/components/Button/Docs.mdx
@@ -1,7 +1,7 @@
import { Canvas, Meta, Unstyled, Source } from '@storybook/blocks';
import * as ButtonStories from './Button.stories';
import { Title, Text } from '../../../docs/components';
-import { PropsTable } from '../../../docs/components/PropsTable';
+import { PropsTable } from '../../../docs/components/PropsTable/PropsTable';
diff --git a/packages/canon/src/components/Container/Docs.mdx b/packages/canon/src/components/Container/Docs.mdx
index 733dbae637..d4dcf694da 100644
--- a/packages/canon/src/components/Container/Docs.mdx
+++ b/packages/canon/src/components/Container/Docs.mdx
@@ -1,7 +1,6 @@
import { Meta, Unstyled, Source } from '@storybook/blocks';
import * as ContainerStories from './Container.stories';
-import { Title, Text } from '../../../docs/components';
-import { PropsTable, getBoxProps } from '../../../docs/components/PropsTable';
+import { Title, Text, PropsTable, getProps } from '../../../docs/components';
import { spacingProperties } from '../../layout/sprinkles.css';
import { containerProperties } from './sprinkles.css';
@@ -29,7 +28,7 @@ import { containerProperties } from './sprinkles.css';
@@ -71,7 +70,7 @@ export default () => (
The grid component also accepts all the spacing props from the Box component.
-
+
Grid Item
diff --git a/packages/canon/src/components/Inline/Docs.mdx b/packages/canon/src/components/Inline/Docs.mdx
index 0469ff0860..9850dedf7a 100644
--- a/packages/canon/src/components/Inline/Docs.mdx
+++ b/packages/canon/src/components/Inline/Docs.mdx
@@ -1,7 +1,6 @@
import { Meta, Unstyled, Source } from '@storybook/blocks';
import * as InlineStories from './Inline.stories';
-import { Title, Text } from '../../../docs/components';
-import { PropsTable, getBoxProps } from '../../../docs/components/PropsTable';
+import { Title, Text, PropsTable, getProps } from '../../../docs/components';
import { spacingProperties } from '../../layout/sprinkles.css';
import { inlineProperties } from './sprinkles.css';
@@ -57,7 +56,7 @@ import { inlineProperties } from './sprinkles.css';
The grid component also accepts all the spacing props from the Box component.
-
+
Examples
diff --git a/packages/canon/src/components/Stack/Docs.mdx b/packages/canon/src/components/Stack/Docs.mdx
index 5ec864937b..d5bdb0fc82 100644
--- a/packages/canon/src/components/Stack/Docs.mdx
+++ b/packages/canon/src/components/Stack/Docs.mdx
@@ -1,7 +1,6 @@
import { Meta, Unstyled, Source } from '@storybook/blocks';
import * as StackStories from './Stack.stories';
-import { Title, Text } from '../../../docs/components';
-import { PropsTable, getBoxProps } from '../../../docs/components/PropsTable';
+import { Title, Text, PropsTable, getProps } from '../../../docs/components';
import { spacingProperties } from '../../layout/sprinkles.css';
@@ -52,7 +51,7 @@ import { spacingProperties } from '../../layout/sprinkles.css';
The grid component also accepts all the spacing props from the Box component.
-
+
Common questions
diff --git a/yarn.lock b/yarn.lock
index d59389cc8c..1e28a7a65d 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -3842,9 +3842,6 @@ __metadata:
"@testing-library/jest-dom": ^6.0.0
"@types/react": ^18.0.0
"@types/react-dom": ^18.0.0
- "@vanilla-extract/css": ^1.16.0
- "@vanilla-extract/dynamic": ^2.1.2
- "@vanilla-extract/recipes": ^0.5.5
"@vanilla-extract/rollup-plugin": ^1.3.10
"@vanilla-extract/sprinkles": ^1.6.3
"@vanilla-extract/webpack-plugin": ^2.3.14
@@ -21548,7 +21545,7 @@ __metadata:
languageName: node
linkType: hard
-"@vanilla-extract/css@npm:^1.16.0, @vanilla-extract/css@npm:^1.16.1":
+"@vanilla-extract/css@npm:^1.16.1":
version: 1.16.1
resolution: "@vanilla-extract/css@npm:1.16.1"
dependencies:
@@ -21568,15 +21565,6 @@ __metadata:
languageName: node
linkType: hard
-"@vanilla-extract/dynamic@npm:^2.1.2":
- version: 2.1.2
- resolution: "@vanilla-extract/dynamic@npm:2.1.2"
- dependencies:
- "@vanilla-extract/private": ^1.0.6
- checksum: ec6ec9b02c7ec8a9d60aebf63225fd3f930c06ad824321f03f683f1948eb6d4e554d934303da140b3230b4af2fa15bab494c6da2a3b9a172e4118c245b4f942a
- languageName: node
- linkType: hard
-
"@vanilla-extract/integration@npm:^7.1.11":
version: 7.1.11
resolution: "@vanilla-extract/integration@npm:7.1.11"
@@ -21604,15 +21592,6 @@ __metadata:
languageName: node
linkType: hard
-"@vanilla-extract/recipes@npm:^0.5.5":
- version: 0.5.5
- resolution: "@vanilla-extract/recipes@npm:0.5.5"
- peerDependencies:
- "@vanilla-extract/css": ^1.0.0
- checksum: 8d2b4f8163369424226ec9a47e754002b8a095bcf86c1a60a91b2183f59508519bd31ed41baefc950ad7ca225d75b3184c3b84d3c741c5c60d91618dd70452aa
- languageName: node
- linkType: hard
-
"@vanilla-extract/rollup-plugin@npm:^1.3.10":
version: 1.3.11
resolution: "@vanilla-extract/rollup-plugin@npm:1.3.11"