@frontify/fondue-components 0.1.0-beta.0 → 0.1.0
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/.storybook/preview.ts +2 -1
- package/CHANGELOG.md +1 -1
- package/package.json +3 -2
- package/src/index.ts +0 -1
- package/src/styles.css +0 -2
- package/src/components/Tag/Tag.ct.tsx +0 -16
- package/src/components/Tag/Tag.stories.ts +0 -29
- package/src/components/Tag/Tag.tsx +0 -18
- package/src/components/Tag/__tests__/tag.spec.tsx +0 -13
package/.storybook/preview.ts
CHANGED
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontify/fondue-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"homepage": "https://github.com/Frontify/fondue",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
".": {
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"import": "./dist/fondue-components.js"
|
|
21
|
-
}
|
|
21
|
+
},
|
|
22
|
+
"./styles": "./dist/style.css"
|
|
22
23
|
},
|
|
23
24
|
"engines": {
|
|
24
25
|
"node": ">=18"
|
package/src/index.ts
CHANGED
package/src/styles.css
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { test, expect } from '@playwright/experimental-ct-react';
|
|
4
|
-
|
|
5
|
-
import { Tag } from './Tag';
|
|
6
|
-
|
|
7
|
-
test('should render without error', async ({ mount }) => {
|
|
8
|
-
const component = await mount(<Tag>Test</Tag>);
|
|
9
|
-
await expect(component).toContainText('Test');
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
test('should allow for the tag to have a border color and background color', async ({ mount }) => {
|
|
13
|
-
const component = await mount(<Tag>Test</Tag>);
|
|
14
|
-
await expect(component).toHaveCSS('background-color', 'rgb(240, 234, 250)');
|
|
15
|
-
await expect(component).toHaveCSS('border-color', 'rgb(124, 87, 255)');
|
|
16
|
-
});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
4
|
-
|
|
5
|
-
import { Tag } from './Tag';
|
|
6
|
-
|
|
7
|
-
type Story = StoryObj<typeof Tag>;
|
|
8
|
-
const meta: Meta<typeof Tag> = {
|
|
9
|
-
component: Tag,
|
|
10
|
-
tags: ['autodocs'],
|
|
11
|
-
parameters: {
|
|
12
|
-
status: {
|
|
13
|
-
type: 'planned',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export default meta;
|
|
18
|
-
|
|
19
|
-
export const Primary: Story = {
|
|
20
|
-
args: {
|
|
21
|
-
children: 'Tag',
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Secondary: Story = {
|
|
26
|
-
args: {
|
|
27
|
-
children: 'Tag',
|
|
28
|
-
},
|
|
29
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { type ReactNode } from 'react';
|
|
4
|
-
|
|
5
|
-
type TagProps = {
|
|
6
|
-
children: ReactNode;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const Tag = ({ children }: TagProps) => {
|
|
10
|
-
return (
|
|
11
|
-
<div
|
|
12
|
-
className="tw-text-text tw-bg-box-selected tw-border-box-selected-strong tw-border-2 tw-p-2 tw-rounded tw-w-fit"
|
|
13
|
-
data-test-id="fondue-tag"
|
|
14
|
-
>
|
|
15
|
-
{children}
|
|
16
|
-
</div>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/* (c) Copyright Frontify Ltd., all rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { render } from '@testing-library/react';
|
|
4
|
-
import { describe, expect, it } from 'vitest';
|
|
5
|
-
|
|
6
|
-
import { Tag } from '../Tag';
|
|
7
|
-
|
|
8
|
-
describe('Tag', () => {
|
|
9
|
-
it('should render', () => {
|
|
10
|
-
const { getByTestId } = render(<Tag>Tag</Tag>);
|
|
11
|
-
expect(getByTestId('fondue-tag')).toBeInTheDocument();
|
|
12
|
-
});
|
|
13
|
-
});
|