@descope/flow-components 2.0.39 → 2.0.41
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/package.json +6 -3
- package/.eslintrc +0 -119
- package/.github/actions/setup/action.yml +0 -42
- package/.github/workflows/ci.yml +0 -105
- package/.github/workflows/publish.yml +0 -40
- package/.github/workflows/release.yml +0 -44
- package/.husky/pre-commit +0 -1
- package/.prettierrc +0 -8
- package/.storybook/main.js +0 -23
- package/.storybook/manager.js +0 -10
- package/.storybook/preview-head.html +0 -29
- package/.storybook/preview.js +0 -44
- package/LICENSE +0 -21
- package/babel.config.js +0 -7
- package/jest.config.js +0 -33
- package/jest.setup.js +0 -2
- package/renovate.json +0 -4
- package/rollup.config.mjs +0 -47
- package/src/Boolean/Boolean.tsx +0 -24
- package/src/Boolean/index.ts +0 -1
- package/src/Button/Button.tsx +0 -49
- package/src/Button/index.ts +0 -1
- package/src/Checkbox/Checkbox.tsx +0 -16
- package/src/Checkbox/index.ts +0 -1
- package/src/Code/Code.tsx +0 -21
- package/src/Code/index.ts +0 -1
- package/src/Container/Container.tsx +0 -111
- package/src/Container/index.ts +0 -1
- package/src/CssVarImage/CssVarImage.tsx +0 -38
- package/src/CssVarImage/index.ts +0 -1
- package/src/Divider/Divider.tsx +0 -33
- package/src/Divider/index.ts +0 -1
- package/src/EmailField/EmailField.tsx +0 -20
- package/src/EmailField/index.ts +0 -1
- package/src/Image/Image.tsx +0 -32
- package/src/Image/index.ts +0 -1
- package/src/Input/Input.tsx +0 -27
- package/src/Input/index.ts +0 -1
- package/src/Link/Link.tsx +0 -33
- package/src/Link/index.ts +0 -1
- package/src/Loader/Loader.tsx +0 -40
- package/src/Loader/index.ts +0 -1
- package/src/Logo/Logo.tsx +0 -27
- package/src/Logo/index.ts +0 -1
- package/src/NewPassword/NewPassword.tsx +0 -25
- package/src/NewPassword/index.ts +0 -1
- package/src/NumberField/NumberField.tsx +0 -20
- package/src/NumberField/index.ts +0 -1
- package/src/Password/Password.tsx +0 -20
- package/src/Password/index.ts +0 -1
- package/src/Phone/Phone.tsx +0 -22
- package/src/Phone/index.ts +0 -1
- package/src/Select/Select.tsx +0 -29
- package/src/Select/index.ts +0 -1
- package/src/Switch/Switch.tsx +0 -21
- package/src/Switch/index.ts +0 -1
- package/src/TOTPImage/TOTPImage.tsx +0 -18
- package/src/TOTPImage/index.ts +0 -1
- package/src/TOTPLink/TOTPLink.tsx +0 -16
- package/src/TOTPLink/index.ts +0 -1
- package/src/Text/Text.tsx +0 -36
- package/src/Text/index.ts +0 -1
- package/src/TextField/TextField.tsx +0 -20
- package/src/TextField/index.ts +0 -1
- package/src/Textarea/Textarea.tsx +0 -20
- package/src/Textarea/index.ts +0 -1
- package/src/icons/apple.tsx +0 -14
- package/src/icons/discord.tsx +0 -14
- package/src/icons/facebook.tsx +0 -14
- package/src/icons/fingerprint.tsx +0 -14
- package/src/icons/github.tsx +0 -14
- package/src/icons/gitlab.tsx +0 -41
- package/src/icons/google.tsx +0 -29
- package/src/icons/index.ts +0 -11
- package/src/icons/input-hidden.tsx +0 -17
- package/src/icons/input-visible.tsx +0 -17
- package/src/icons/linkedin.tsx +0 -18
- package/src/icons/microsoft.tsx +0 -41
- package/src/icons/passkey.tsx +0 -16
- package/src/icons/sso.tsx +0 -14
- package/src/index.ts +0 -25
- package/src/inputHelpers.ts +0 -41
- package/src/types.ts +0 -52
- package/src/utils.tsx +0 -69
- package/stories/Boolean.stories.jsx +0 -37
- package/stories/Button.stories.jsx +0 -71
- package/stories/Checkbox.stories.jsx +0 -29
- package/stories/Code.stories.jsx +0 -60
- package/stories/Container.stories.jsx +0 -53
- package/stories/Divider.stories.jsx +0 -23
- package/stories/EmailField.stories.jsx +0 -36
- package/stories/Image.stories.jsx +0 -16
- package/stories/Input.stories.jsx +0 -63
- package/stories/Link.stories.jsx +0 -21
- package/stories/Loader.stories.jsx +0 -34
- package/stories/Logo.stories.jsx +0 -14
- package/stories/NewPassword.stories.jsx +0 -52
- package/stories/NumberField.stories.jsx +0 -35
- package/stories/Password.stories.jsx +0 -37
- package/stories/Phone.stories.jsx +0 -61
- package/stories/Switch.stories.jsx +0 -29
- package/stories/TOTPImage.stories.jsx +0 -22
- package/stories/TOTPLink.stories.jsx +0 -20
- package/stories/Text.stories.jsx +0 -35
- package/stories/TextField.stories.jsx +0 -39
- package/stories/Textarea.stories.jsx +0 -25
- package/storybook-static/favicon.ico +0 -0
- package/test/__snapshots__/boolean.test.tsx.snap +0 -47
- package/test/__snapshots__/buttons.test.tsx.snap +0 -843
- package/test/__snapshots__/checkbox.test.tsx.snap +0 -51
- package/test/__snapshots__/code.test.tsx.snap +0 -1184
- package/test/__snapshots__/container.test.tsx.snap +0 -218
- package/test/__snapshots__/divider.test.tsx.snap +0 -73
- package/test/__snapshots__/image.test.tsx.snap +0 -62
- package/test/__snapshots__/input.test.tsx.snap +0 -80
- package/test/__snapshots__/link.test.tsx.snap +0 -120
- package/test/__snapshots__/loader.test.tsx.snap +0 -53
- package/test/__snapshots__/logo.test.tsx.snap +0 -10
- package/test/__snapshots__/newPassword.test.tsx.snap +0 -69
- package/test/__snapshots__/numeric-input.test.tsx.snap +0 -21
- package/test/__snapshots__/password.test.tsx.snap +0 -26
- package/test/__snapshots__/phone.test.tsx.snap +0 -504
- package/test/__snapshots__/switch.test.tsx.snap +0 -51
- package/test/__snapshots__/text.test.tsx.snap +0 -89
- package/test/__snapshots__/textarea.test.tsx.snap +0 -73
- package/test/__snapshots__/themeToCssVars.test.ts.snap +0 -45
- package/test/__snapshots__/totpImage.test.tsx.snap +0 -10
- package/test/__snapshots__/totpLink.test.tsx.snap +0 -13
- package/test/boolean.test.tsx +0 -28
- package/test/buttons.test.tsx +0 -66
- package/test/checkbox.test.tsx +0 -67
- package/test/code.test.tsx +0 -182
- package/test/container.test.tsx +0 -91
- package/test/divider.test.tsx +0 -50
- package/test/image.test.tsx +0 -40
- package/test/input.test.tsx +0 -82
- package/test/inputHelpers.test.tsx +0 -58
- package/test/link.test.tsx +0 -71
- package/test/loader.test.tsx +0 -25
- package/test/logo.test.tsx +0 -10
- package/test/newPassword.test.tsx +0 -132
- package/test/numeric-input.test.tsx +0 -114
- package/test/password.test.tsx +0 -55
- package/test/phone.test.tsx +0 -158
- package/test/switch.test.tsx +0 -67
- package/test/text.test.tsx +0 -60
- package/test/textarea.test.tsx +0 -64
- package/test/themeToCssVars.test.ts +0 -82
- package/test/totpImage.test.tsx +0 -10
- package/test/totpLink.test.tsx +0 -10
- package/tsconfig.json +0 -20
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope/flow-components",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.41",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -22,11 +22,14 @@
|
|
|
22
22
|
"url": "git+https://github.com/descope/flow-components.git"
|
|
23
23
|
},
|
|
24
24
|
"author": "Descope",
|
|
25
|
-
"license": "
|
|
25
|
+
"license": "UNLICENSED",
|
|
26
26
|
"bugs": {
|
|
27
27
|
"url": "https://github.com/descope/flow-components/issues"
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/descope/flow-components#readme",
|
|
30
|
+
"files": [
|
|
31
|
+
"dist"
|
|
32
|
+
],
|
|
30
33
|
"lint-staged": {
|
|
31
34
|
"+(src|test)/**/*.{js,ts,jsx,tsx}": [
|
|
32
35
|
"npm run lint"
|
|
@@ -66,7 +69,7 @@
|
|
|
66
69
|
"eslint-config-standard": "17.0.0",
|
|
67
70
|
"eslint-import-resolver-typescript": "3.5.5",
|
|
68
71
|
"eslint-plugin-import": "2.27.5",
|
|
69
|
-
"eslint-plugin-jest": "27.2.
|
|
72
|
+
"eslint-plugin-jest": "27.2.2",
|
|
70
73
|
"eslint-plugin-jest-dom": "4.0.3",
|
|
71
74
|
"eslint-plugin-jest-formatting": "3.1.0",
|
|
72
75
|
"eslint-plugin-jsx-a11y": "^6.6.1",
|
package/.eslintrc
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"env": {
|
|
3
|
-
"browser": true,
|
|
4
|
-
"es2021": true
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"airbnb",
|
|
8
|
-
"airbnb-typescript",
|
|
9
|
-
"plugin:import/typescript",
|
|
10
|
-
"prettier",
|
|
11
|
-
"plugin:testing-library/react",
|
|
12
|
-
"plugin:jest-dom/recommended"
|
|
13
|
-
],
|
|
14
|
-
"parser": "@typescript-eslint/parser",
|
|
15
|
-
"ignorePatterns": [
|
|
16
|
-
".eslintrc",
|
|
17
|
-
"jest.config.js",
|
|
18
|
-
"babel.config.js",
|
|
19
|
-
"build/*",
|
|
20
|
-
"dist/*",
|
|
21
|
-
"webpack.config.js",
|
|
22
|
-
"bundle/*",
|
|
23
|
-
"coverage/*",
|
|
24
|
-
"testUtils/*"
|
|
25
|
-
],
|
|
26
|
-
"parserOptions": {
|
|
27
|
-
"ecmaFeatures": {
|
|
28
|
-
"jsx": true
|
|
29
|
-
},
|
|
30
|
-
"ecmaVersion": "latest",
|
|
31
|
-
"sourceType": "module",
|
|
32
|
-
"project": "./tsconfig.json"
|
|
33
|
-
},
|
|
34
|
-
"plugins": [
|
|
35
|
-
"react",
|
|
36
|
-
"@typescript-eslint",
|
|
37
|
-
"prettier",
|
|
38
|
-
"testing-library",
|
|
39
|
-
"import",
|
|
40
|
-
"prefer-arrow",
|
|
41
|
-
"jest-dom",
|
|
42
|
-
"jest",
|
|
43
|
-
"jest-formatting",
|
|
44
|
-
"no-only-tests"
|
|
45
|
-
],
|
|
46
|
-
"settings": {
|
|
47
|
-
"import/parsers": {
|
|
48
|
-
"@typescript-eslint/parser": [".ts", ".tsx"]
|
|
49
|
-
},
|
|
50
|
-
"import/resolver": {
|
|
51
|
-
"typescript": {
|
|
52
|
-
"alwaysTryTypes": true
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"rules": {
|
|
57
|
-
"no-tabs": ["error", { "allowIndentationTabs": true }],
|
|
58
|
-
"@typescript-eslint/indent": ["off"],
|
|
59
|
-
"react/jsx-indent": [2, "tab"],
|
|
60
|
-
"quotes": [
|
|
61
|
-
"error",
|
|
62
|
-
"single",
|
|
63
|
-
{ "avoidEscape": true, "allowTemplateLiterals": true }
|
|
64
|
-
],
|
|
65
|
-
"@typescript-eslint/quotes": [
|
|
66
|
-
"error",
|
|
67
|
-
"single",
|
|
68
|
-
{ "avoidEscape": true, "allowTemplateLiterals": true }
|
|
69
|
-
],
|
|
70
|
-
"@typescript-eslint/comma-dangle": ["off"],
|
|
71
|
-
"comma-dangle": ["off"],
|
|
72
|
-
"react/function-component-definition": [
|
|
73
|
-
2,
|
|
74
|
-
{
|
|
75
|
-
"namedComponents": "arrow-function",
|
|
76
|
-
"unnamedComponents": "arrow-function"
|
|
77
|
-
}
|
|
78
|
-
],
|
|
79
|
-
"import/prefer-default-export": ["off"],
|
|
80
|
-
"react/prop-types": ["off"],
|
|
81
|
-
"react/require-default-props": ["off"],
|
|
82
|
-
"react/jsx-props-no-spreading": ["off"],
|
|
83
|
-
"prefer-arrow/prefer-arrow-functions": [
|
|
84
|
-
2,
|
|
85
|
-
{
|
|
86
|
-
"disallowPrototype": true,
|
|
87
|
-
"singleReturnOnly": false,
|
|
88
|
-
"classPropertiesAllowed": false
|
|
89
|
-
}
|
|
90
|
-
],
|
|
91
|
-
"no-console": 2,
|
|
92
|
-
"no-only-tests/no-only-tests": 2,
|
|
93
|
-
"no-warning-comments": 2,
|
|
94
|
-
"import/no-unresolved": 2,
|
|
95
|
-
"import/named": 2,
|
|
96
|
-
"import/no-relative-packages": 2,
|
|
97
|
-
"import/no-cycle": 2,
|
|
98
|
-
"import/newline-after-import": 2,
|
|
99
|
-
"import/no-namespace": 2,
|
|
100
|
-
"import/no-duplicates": 2,
|
|
101
|
-
"import/first": 2,
|
|
102
|
-
"import/exports-last": 0,
|
|
103
|
-
"import/no-absolute-path": 2,
|
|
104
|
-
"import/no-dynamic-require": 2,
|
|
105
|
-
"import/no-self-import": 2,
|
|
106
|
-
"import/no-useless-path-segments": 2,
|
|
107
|
-
"import/no-extraneous-dependencies": [
|
|
108
|
-
2,
|
|
109
|
-
{
|
|
110
|
-
"devDependencies": [
|
|
111
|
-
"**/*.test.*",
|
|
112
|
-
"**/*.spec.*",
|
|
113
|
-
"**/testUtils/**",
|
|
114
|
-
"jest.config.ts"
|
|
115
|
-
]
|
|
116
|
-
}
|
|
117
|
-
]
|
|
118
|
-
}
|
|
119
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
name: Setup
|
|
2
|
-
description: Setup
|
|
3
|
-
inputs:
|
|
4
|
-
node_version:
|
|
5
|
-
description: Node version to use
|
|
6
|
-
required: true
|
|
7
|
-
repo-token:
|
|
8
|
-
description: Repo token to use
|
|
9
|
-
required: true
|
|
10
|
-
runs:
|
|
11
|
-
using: composite
|
|
12
|
-
steps:
|
|
13
|
-
- name: Setup Node.js 🔠
|
|
14
|
-
uses: actions/setup-node@v3
|
|
15
|
-
with:
|
|
16
|
-
node-version: ${{ inputs.node_version }}
|
|
17
|
-
|
|
18
|
-
- name: Cache node modules 💸
|
|
19
|
-
uses: actions/cache@v3
|
|
20
|
-
env:
|
|
21
|
-
cache-name: cache-node-modules
|
|
22
|
-
with:
|
|
23
|
-
# npm cache files are stored in `~/.npm` on Linux/macOS
|
|
24
|
-
path: ~/.npm
|
|
25
|
-
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
26
|
-
restore-keys: |
|
|
27
|
-
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
28
|
-
${{ runner.os }}-build-
|
|
29
|
-
${{ runner.os }}-
|
|
30
|
-
|
|
31
|
-
- name: Install Dependencies 🪛
|
|
32
|
-
shell: bash
|
|
33
|
-
# Skip post-install scripts here, as a malicious
|
|
34
|
-
# script could steal NODE_AUTH_TOKEN.
|
|
35
|
-
run: npm ci --ignore-scripts
|
|
36
|
-
env:
|
|
37
|
-
CI: true
|
|
38
|
-
# `npm rebuild` will run all those post-install scripts for us.
|
|
39
|
-
- run: npm rebuild && npm run prepare --if-present
|
|
40
|
-
shell: bash
|
|
41
|
-
env:
|
|
42
|
-
CI: true
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
name: 🎛️ CI
|
|
2
|
-
|
|
3
|
-
on: [push]
|
|
4
|
-
|
|
5
|
-
env:
|
|
6
|
-
NODE_VERSION: 18.2
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
name: 👷 Build
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
steps:
|
|
13
|
-
- name: Checkout code
|
|
14
|
-
uses: actions/checkout@v3
|
|
15
|
-
- uses: actions/setup-node@v3
|
|
16
|
-
with:
|
|
17
|
-
node-version: ${{ env.NODE_VERSION }}
|
|
18
|
-
registry-url: https://npm.pkg.github.com/
|
|
19
|
-
# Skip post-install scripts here, as a malicious
|
|
20
|
-
# script could steal NODE_AUTH_TOKEN.
|
|
21
|
-
- name: Install dependencies
|
|
22
|
-
run: npm ci --ignore-scripts
|
|
23
|
-
env:
|
|
24
|
-
CI: true
|
|
25
|
-
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
|
|
26
|
-
# `npm rebuild` will run all those post-install scripts for us.
|
|
27
|
-
- run: npm rebuild && npm run prepare --if-present
|
|
28
|
-
- name: Building
|
|
29
|
-
run: npm run build
|
|
30
|
-
env:
|
|
31
|
-
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
|
|
32
|
-
|
|
33
|
-
lint:
|
|
34
|
-
name: 🪥 Lint
|
|
35
|
-
runs-on: ubuntu-latest
|
|
36
|
-
steps:
|
|
37
|
-
- name: Checkout code
|
|
38
|
-
uses: actions/checkout@v3
|
|
39
|
-
- uses: actions/setup-node@v3
|
|
40
|
-
with:
|
|
41
|
-
node-version: ${{ env.NODE_VERSION }}
|
|
42
|
-
registry-url: https://npm.pkg.github.com/
|
|
43
|
-
# Skip post-install scripts here, as a malicious
|
|
44
|
-
# script could steal NODE_AUTH_TOKEN.
|
|
45
|
-
- name: Install dependencies
|
|
46
|
-
run: npm ci --ignore-scripts
|
|
47
|
-
env:
|
|
48
|
-
CI: true
|
|
49
|
-
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
|
|
50
|
-
# `npm rebuild` will run all those post-install scripts for us.
|
|
51
|
-
- run: npm rebuild && npm run prepare --if-present
|
|
52
|
-
- name: Linting
|
|
53
|
-
run: npm run lint
|
|
54
|
-
|
|
55
|
-
testing:
|
|
56
|
-
name: 👔 Test
|
|
57
|
-
runs-on: ubuntu-latest
|
|
58
|
-
steps:
|
|
59
|
-
- name: Checkout code
|
|
60
|
-
uses: actions/checkout@v3
|
|
61
|
-
- uses: actions/setup-node@v3
|
|
62
|
-
with:
|
|
63
|
-
node-version: ${{ env.NODE_VERSION }}
|
|
64
|
-
registry-url: https://npm.pkg.github.com/
|
|
65
|
-
# Skip post-install scripts here, as a malicious
|
|
66
|
-
# script could steal NODE_AUTH_TOKEN.
|
|
67
|
-
- name: Install dependencies
|
|
68
|
-
run: npm ci --ignore-scripts
|
|
69
|
-
env:
|
|
70
|
-
CI: true
|
|
71
|
-
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
|
|
72
|
-
# `npm rebuild` will run all those post-install scripts for us.
|
|
73
|
-
- run: npm rebuild && npm run prepare --if-present
|
|
74
|
-
- name: Testing
|
|
75
|
-
run: npm run test
|
|
76
|
-
# - name: Coverage check
|
|
77
|
-
# uses: devmasx/coverage-check-action@v1.2.0
|
|
78
|
-
# with:
|
|
79
|
-
# type: lcov
|
|
80
|
-
# min_coverage: 95
|
|
81
|
-
# result_path: coverage/lcov.info
|
|
82
|
-
# token: ${{ github.token }}
|
|
83
|
-
|
|
84
|
-
license-validation:
|
|
85
|
-
name: 🪪 License Validation
|
|
86
|
-
runs-on: ubuntu-latest
|
|
87
|
-
steps:
|
|
88
|
-
- name: Checkout code
|
|
89
|
-
uses: actions/checkout@v3
|
|
90
|
-
- uses: actions/setup-node@v3
|
|
91
|
-
with:
|
|
92
|
-
node-version: ${{ env.NODE_VERSION }}
|
|
93
|
-
registry-url: https://npm.pkg.github.com/
|
|
94
|
-
# Skip post-install scripts here, as a malicious
|
|
95
|
-
# script could steal NODE_AUTH_TOKEN.
|
|
96
|
-
- name: Install dependencies
|
|
97
|
-
run: npm ci --ignore-scripts
|
|
98
|
-
env:
|
|
99
|
-
CI: true
|
|
100
|
-
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
|
|
101
|
-
# `npm rebuild` will run all those post-install scripts for us.
|
|
102
|
-
- run: npm rebuild && npm run prepare --if-present
|
|
103
|
-
- name: License validation
|
|
104
|
-
shell: bash
|
|
105
|
-
run: echo no validation
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
name: 📢 publish
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
create:
|
|
5
|
-
tags:
|
|
6
|
-
- 'release/**'
|
|
7
|
-
|
|
8
|
-
env:
|
|
9
|
-
NODE_VERSION: 18.2
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
publish:
|
|
13
|
-
name: 📢 Publish
|
|
14
|
-
permissions:
|
|
15
|
-
packages: write
|
|
16
|
-
contents: read
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
|
|
19
|
-
steps:
|
|
20
|
-
- uses: actions/checkout@v3
|
|
21
|
-
- uses: actions/setup-node@v3
|
|
22
|
-
with:
|
|
23
|
-
node-version: ${{ env.NODE_VERSION }}
|
|
24
|
-
registry-url: https://registry.npmjs.org/
|
|
25
|
-
# Skip post-install scripts here, as a malicious
|
|
26
|
-
# script could steal NODE_AUTH_TOKEN.
|
|
27
|
-
- name: Install dependencies
|
|
28
|
-
run: npm ci --ignore-scripts
|
|
29
|
-
env:
|
|
30
|
-
CI: true
|
|
31
|
-
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_READ_ORG }}
|
|
32
|
-
# `npm rebuild` will run all those post-install scripts for us.
|
|
33
|
-
- run: npm run build
|
|
34
|
-
- run: npm rebuild && npm run prepare --if-present
|
|
35
|
-
|
|
36
|
-
- name: Publish to NPM Package Registry
|
|
37
|
-
run: npm publish --access=public
|
|
38
|
-
env:
|
|
39
|
-
CI: true
|
|
40
|
-
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_REGISTRY }}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
name: 👊 Bump Version & Release
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
bump-version:
|
|
10
|
-
name: 👊 Bump Version & Release
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout source code
|
|
15
|
-
uses: actions/checkout@v3
|
|
16
|
-
with:
|
|
17
|
-
persist-credentials: false
|
|
18
|
-
ref: ${{ github.ref }}
|
|
19
|
-
- name: cat package.json
|
|
20
|
-
run: |
|
|
21
|
-
cat ./package.json
|
|
22
|
-
git config user.name "Descope"
|
|
23
|
-
git config user.email "107609351+descope[bot]@users.noreply.github.com"
|
|
24
|
-
|
|
25
|
-
- name: Get token
|
|
26
|
-
id: get_token
|
|
27
|
-
uses: tibdex/github-app-token@v1
|
|
28
|
-
with:
|
|
29
|
-
private_key: ${{ secrets.APP_PEM }}
|
|
30
|
-
app_id: ${{ secrets.APP_ID }}
|
|
31
|
-
|
|
32
|
-
- name: Automated Version Bump
|
|
33
|
-
id: version-bump
|
|
34
|
-
uses: phips28/gh-action-bump-version@master
|
|
35
|
-
with:
|
|
36
|
-
tag-prefix: release/v
|
|
37
|
-
env:
|
|
38
|
-
GITHUB_TOKEN: ${{ steps.get_token.outputs.token }}
|
|
39
|
-
- name: cat package.json
|
|
40
|
-
run: cat ./package.json
|
|
41
|
-
- name: Output Step
|
|
42
|
-
env:
|
|
43
|
-
NEW_TAG: ${{ steps.version-bump.outputs.newTag }}
|
|
44
|
-
run: echo "new tag $NEW_TAG"
|
package/.husky/pre-commit
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
npm run format-lint
|
package/.prettierrc
DELETED
package/.storybook/main.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
stories: [
|
|
3
|
-
'../stories/**/*.stories.mdx',
|
|
4
|
-
'../stories/**/*.stories.@(js|jsx|ts|tsx)'
|
|
5
|
-
],
|
|
6
|
-
addons: [
|
|
7
|
-
'@storybook/addon-links',
|
|
8
|
-
'@storybook/addon-essentials',
|
|
9
|
-
'storybook-addon-themes',
|
|
10
|
-
{
|
|
11
|
-
name: '@storybook/addon-postcss',
|
|
12
|
-
options: {
|
|
13
|
-
postcssLoaderOptions: {
|
|
14
|
-
implementation: require('postcss')
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
],
|
|
19
|
-
framework: '@storybook/react',
|
|
20
|
-
core: {
|
|
21
|
-
builder: '@storybook/builder-webpack5'
|
|
22
|
-
}
|
|
23
|
-
};
|
package/.storybook/manager.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
// Handle theme changes
|
|
3
|
-
|
|
4
|
-
// Since the storybook-addon-themes addon sets class, and daisyUI uses data-theme,
|
|
5
|
-
// we have to do some custom handling. Theme changes occur in preview.js and set
|
|
6
|
-
// a local storage value. We will listen to changes to this value and update
|
|
7
|
-
// the data-theme attribute on the storybook preview iframe
|
|
8
|
-
|
|
9
|
-
// Get/use initial or default values
|
|
10
|
-
const defaultTheme = 'light';
|
|
11
|
-
let cachedTheme = window.localStorage.getItem('wcui-theme') ?? defaultTheme;
|
|
12
|
-
document.documentElement.setAttribute('data-theme', cachedTheme);
|
|
13
|
-
|
|
14
|
-
// Listen for changes to localstorage
|
|
15
|
-
window.addEventListener('storage', () => {
|
|
16
|
-
let theme = window.localStorage.getItem('wcui-theme');
|
|
17
|
-
if (theme !== cachedTheme) {
|
|
18
|
-
// Update data-theme attribute
|
|
19
|
-
document.documentElement.setAttribute(
|
|
20
|
-
'data-theme',
|
|
21
|
-
theme ?? defaultTheme
|
|
22
|
-
);
|
|
23
|
-
// update theme variable to the new theme
|
|
24
|
-
cachedTheme = theme || defaultTheme;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
</script>
|
|
28
|
-
|
|
29
|
-
<style></style>
|
package/.storybook/preview.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
themeToStyle,
|
|
3
|
-
defaultTheme,
|
|
4
|
-
componentsThemeManager
|
|
5
|
-
} from '@descope/web-components-ui';
|
|
6
|
-
|
|
7
|
-
const style = document.createElement('style');
|
|
8
|
-
style.id = 'gen';
|
|
9
|
-
const lightTheme = themeToStyle(defaultTheme, 'light');
|
|
10
|
-
// todo: fix dark theme
|
|
11
|
-
const darkTheme = themeToStyle(defaultTheme, 'dark');
|
|
12
|
-
|
|
13
|
-
style.innerHTML = lightTheme.globals + darkTheme.globals;
|
|
14
|
-
document.head.append(style);
|
|
15
|
-
componentsThemeManager.themes = {
|
|
16
|
-
light: lightTheme.components,
|
|
17
|
-
dark: darkTheme.components
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
export const parameters = {
|
|
21
|
-
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
22
|
-
controls: {
|
|
23
|
-
matchers: {
|
|
24
|
-
color: /(background|color)$/i,
|
|
25
|
-
date: /Date$/
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
themes: {
|
|
29
|
-
default: 'light',
|
|
30
|
-
onChange: (theme) => {
|
|
31
|
-
if (theme) {
|
|
32
|
-
window.localStorage.setItem('wcui-theme', theme.class);
|
|
33
|
-
document.body.setAttribute('data-theme', theme.class);
|
|
34
|
-
componentsThemeManager.currentThemeName = theme;
|
|
35
|
-
} else {
|
|
36
|
-
window.localStorage.removeItem('wcui-theme');
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
list: [
|
|
40
|
-
{ name: 'light', class: 'light', color: '#fff' },
|
|
41
|
-
{ name: 'dark', class: 'dark', color: '#000' }
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
};
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 Descope
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/babel.config.js
DELETED
package/jest.config.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
const { pathsToModuleNameMapper } = require('ts-jest');
|
|
2
|
-
const { compilerOptions } = require('./tsconfig.json');
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
// Automatically clear mock calls, instances, contexts and results before every test
|
|
6
|
-
clearMocks: true,
|
|
7
|
-
|
|
8
|
-
collectCoverage: true,
|
|
9
|
-
coverageDirectory: 'coverage',
|
|
10
|
-
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
|
|
11
|
-
|
|
12
|
-
// A set of global variables that need to be available in all test environments
|
|
13
|
-
globals: {
|
|
14
|
-
'ts-jest': {
|
|
15
|
-
tsconfig: 'tsconfig.json'
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
preset: 'ts-jest',
|
|
20
|
-
testEnvironment: 'jsdom',
|
|
21
|
-
moduleDirectories: ['node_modules', 'src'],
|
|
22
|
-
|
|
23
|
-
testTimeout: 2000,
|
|
24
|
-
|
|
25
|
-
transform: {
|
|
26
|
-
'\\.[jt]sx?$': 'babel-jest'
|
|
27
|
-
},
|
|
28
|
-
roots: ['src', 'test'],
|
|
29
|
-
setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
|
|
30
|
-
snapshotFormat: {
|
|
31
|
-
escapeString: true
|
|
32
|
-
}
|
|
33
|
-
};
|
package/jest.setup.js
DELETED
package/renovate.json
DELETED
package/rollup.config.mjs
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import typescript from '@rollup/plugin-typescript';
|
|
2
|
-
import del from 'rollup-plugin-delete';
|
|
3
|
-
import autoExternal from 'rollup-plugin-auto-external';
|
|
4
|
-
import dts from 'rollup-plugin-dts';
|
|
5
|
-
|
|
6
|
-
import packageJson from './package.json' assert { type: 'json' };
|
|
7
|
-
|
|
8
|
-
export default [
|
|
9
|
-
{
|
|
10
|
-
input: 'src/index.ts',
|
|
11
|
-
output: {
|
|
12
|
-
file: packageJson.module,
|
|
13
|
-
format: 'esm',
|
|
14
|
-
interop: 'compat'
|
|
15
|
-
},
|
|
16
|
-
plugins: [
|
|
17
|
-
autoExternal(),
|
|
18
|
-
del({ targets: 'dist' }),
|
|
19
|
-
typescript({
|
|
20
|
-
rootDir: './src'
|
|
21
|
-
})
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
input: 'src/index.ts',
|
|
26
|
-
output: {
|
|
27
|
-
file: packageJson.main,
|
|
28
|
-
format: 'cjs',
|
|
29
|
-
interop: 'compat'
|
|
30
|
-
},
|
|
31
|
-
plugins: [
|
|
32
|
-
autoExternal(),
|
|
33
|
-
typescript({
|
|
34
|
-
rootDir: './src'
|
|
35
|
-
})
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
input: './dist/dts/index.d.ts',
|
|
40
|
-
output: [{ file: packageJson.types, format: 'esm' }],
|
|
41
|
-
plugins: [
|
|
42
|
-
dts(),
|
|
43
|
-
del({ hook: 'buildEnd', targets: ['./dist/dts', './dist/cjs/dts'] })
|
|
44
|
-
// cjsPackage(),
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
];
|
package/src/Boolean/Boolean.tsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Checkbox } from '../Checkbox';
|
|
3
|
-
import { Switch } from '../Switch';
|
|
4
|
-
|
|
5
|
-
type BooleanType = { type: 'switch' | 'checkbox' };
|
|
6
|
-
|
|
7
|
-
type Props = React.ComponentProps<typeof Checkbox> &
|
|
8
|
-
React.ComponentProps<typeof Switch> &
|
|
9
|
-
BooleanType;
|
|
10
|
-
|
|
11
|
-
const Boolean = React.forwardRef<HTMLInputElement, Props>(
|
|
12
|
-
({ type, ...props }, ref) => {
|
|
13
|
-
switch (type) {
|
|
14
|
-
case 'checkbox':
|
|
15
|
-
return <Checkbox {...props} ref={ref} />;
|
|
16
|
-
case 'switch':
|
|
17
|
-
return <Switch {...props} ref={ref} />;
|
|
18
|
-
default:
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
export default Boolean;
|
package/src/Boolean/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Boolean } from './Boolean';
|