@strapi/ui-primitives 1.7.0-alpha.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/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2015-present Strapi Solutions SAS
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # Strapi Primitives
2
+
3
+ [![Version](https://img.shields.io/npm/v/@strapi/ui-primitives?style=flat&colorA=4945ff&colorB=4945ff)](https://www.npmjs.com/package/@strapi/ui-primitives)
4
+ [![Downloads](https://img.shields.io/npm/dt/@strapi/ui-primitives.svg?style=flat&colorA=4945ff&colorB=4945ff)](https://www.npmjs.com/package/@strapi/ui-primitives)
5
+ [![Discord Shield](https://img.shields.io/discord/811989166782021633?style=flat&colorA=4945ff&colorB=4945ff&label=discord&logo=discord&logoColor=f0f0ff)](https://discord.gg/strapi)
6
+
7
+ <b>A UI component library for building accessibile design systems & web apps.</b>
8
+
9
+ While typically we use [radix-ui primitives](https://github.com/radix-ui/primitives) in our design-system, there are some missing components. To solve this issue, we work with Radix's internal packages & APIs to develop base layer primitives in a composable manor until they are (hopefully) released through Radix and we can deprecate them here.
10
+
11
+ ## Installation
12
+
13
+ ```shell
14
+ yarn add @strapi/ui-primitives
15
+
16
+ # or
17
+
18
+ npm i @strapi/ui-primitives
19
+ ```
20
+
21
+ ## Component Documentation
22
+
23
+ This directory shows a basic usage of the component, however for more details click on the storybook badge.
24
+
25
+ <ul>
26
+ <li><a href="#combobox">Combobox</a></li>
27
+ <li><a href="#select">Select</a></li>
28
+ </ul>
29
+
30
+ ### Combobox
31
+
32
+ [![](https://img.shields.io/badge/-storybook-%234945ff)](https://design-system-git-main-strapijs.vercel.app/?path=/story/design-system-primitives-combobox--basic-usage)
33
+
34
+ #### Basic Usage
35
+
36
+ ```jsx
37
+ import { Combobox } from '@strapi/ui-primitives';
38
+
39
+ () => {
40
+ return (
41
+ <Combobox.Root>
42
+ <Combobox.Trigger>
43
+ <Combobox.TextInput placeholder="Pick me" />
44
+ <Combobox.Icon />
45
+ </Combobox.Trigger>
46
+ <Combobox.Portal>
47
+ <Combobox.Content>
48
+ <Combobox.Viewport>
49
+ <Combobox.Item value="1">
50
+ <Combobox.ItemText>Option 1</Combobox.ItemText>
51
+ <Combobox.ItemIndicator>
52
+ <Check />
53
+ </Combobox.ItemIndicator>
54
+ </Combobox.Item>
55
+ <Combobox.NoValueFound>No value found</Combobox.NoValueFound>
56
+ <Combobox.CreateItem>Create a new value</Combobox.CreateItem>
57
+ </Combobox.Viewport>
58
+ </Combobox.Content>
59
+ </Combobox.Portal>
60
+ </Combobox.Root>
61
+ );
62
+ };
63
+ ```
64
+
65
+ ### Select
66
+
67
+ [![](https://img.shields.io/badge/-storybook-%234945ff)](https://design-system-git-main-strapijs.vercel.app/?path=/story/design-system-primitives-select--basic-usage)
68
+
69
+ #### Basic Usage
70
+
71
+ ```jsx
72
+ import { Select } from '@strapi/ui-primitives';
73
+
74
+ () => {
75
+ return (
76
+ <Select.Root>
77
+ <Select.Trigger>
78
+ <Select.Value placeholder="Pick me" />
79
+ <Select.Icon />
80
+ </Select.Trigger>
81
+ <Select.Portal>
82
+ <Select.Content>
83
+ <Select.Viewport>
84
+ <Select.Item value="1">
85
+ <Select.ItemText>Option 1</Select.ItemText>
86
+ <Select.ItemIndicator>
87
+ <Check />
88
+ </Select.ItemIndicator>
89
+ </Select.Item>
90
+ </Select.Viewport>
91
+ </Select.Content>
92
+ </Select.Portal>
93
+ </Select.Root>
94
+ );
95
+ };
96
+ ```
97
+
98
+ ## Contributing
99
+
100
+ Please follow our [CONTRIBUTING](https://github.com/strapi/design-system/blob/main/CONTRIBUTING.md) guidelines.
101
+
102
+ ## License
103
+
104
+ Licensed under the MIT License, Copyright © 2022-present [Strapi Solutions SAS](https://strapi.io).
105
+
106
+ See [LICENSE](https://github.com/strapi/design-system/blob/main/LICENSE) for more information.
File without changes
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@strapi/ui-primitives",
3
+ "version": "1.7.0-alpha.0",
4
+ "license": "MIT",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "main": "./dist/index.cjs",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "files": [
11
+ "dist"
12
+ ],
13
+ "scripts": {
14
+ "develop": "vite build --watch",
15
+ "prebuild": "rimraf dist",
16
+ "build": "yarn build:prod",
17
+ "build:prod": "vite build",
18
+ "lint": "eslint . --ext .js,.jsx,.tsx,.ts",
19
+ "format": "yarn lint --fix",
20
+ "test": "jest -c jest.config.js",
21
+ "test:ts": "tsc --noEmit",
22
+ "test:watch": "jest -c jest.config.js --watchAll"
23
+ },
24
+ "dependencies": {
25
+ "@radix-ui/number": "^1.0.0",
26
+ "@radix-ui/primitive": "^1.0.0",
27
+ "@radix-ui/react-compose-refs": "^1.0.0",
28
+ "@radix-ui/react-context": "^1.0.0",
29
+ "@radix-ui/react-dismissable-layer": "^1.0.2",
30
+ "@radix-ui/react-id": "^1.0.0",
31
+ "@radix-ui/react-popper": "^1.1.0",
32
+ "@radix-ui/react-portal": "^1.0.1",
33
+ "@radix-ui/react-primitive": "^1.0.1",
34
+ "@radix-ui/react-slot": "^1.0.1",
35
+ "@radix-ui/react-use-controllable-state": "^1.0.0",
36
+ "@radix-ui/react-use-previous": "^1.0.0",
37
+ "@radix-ui/react-visually-hidden": "^1.0.2",
38
+ "aria-hidden": "^1.2.2",
39
+ "react-remove-scroll": "^2.5.5"
40
+ },
41
+ "peerDependencies": {
42
+ "react": "^17.0.1",
43
+ "react-dom": "^17.0.1"
44
+ },
45
+ "devDependencies": {
46
+ "vite-plugin-dts": "^1.7.2"
47
+ },
48
+ "gitHead": "bfa7842f4ee458f8078a197dc9c34c9a2902d057"
49
+ }