@cyishere/react-uikit 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.
@@ -0,0 +1,86 @@
1
+ /* vars only, no output */
2
+ .ruk-unstyled-button {
3
+ text-align: center;
4
+ font: inherit;
5
+ color: inherit;
6
+ background: transparent;
7
+ border: none;
8
+ display: block;
9
+ margin: 0;
10
+ padding: 0;
11
+ cursor: pointer;
12
+ }
13
+ .ruk-unstyled-button:focus {
14
+ outline-offset: 2px;
15
+ }
16
+ .ruk-unstyled-button:focus:not(:focus-visible) {
17
+ outline: none;
18
+ }
19
+ .uk-tab {
20
+ --tab-item-color: #999;
21
+ --tab-item-active-color: #333;
22
+ --tab-item-active-border: #1e87f0;
23
+ }
24
+ .uk-subnav-pill {
25
+ --subnav-item-color: #999;
26
+ --subnav-pill-item-active-color: #fff;
27
+ --subnav-pill-item-active-background: #1e87f0;
28
+ }
29
+ .ruk-switcher-list.uk-list > :nth-child(n + 2) {
30
+ margin-top: 0;
31
+ }
32
+ .ruk-switcher-list.uk-flex {
33
+ gap: var(--switcher-trigger-gutter, 5px);
34
+ }
35
+ .uk-tab .ruk-switcher-trigger-button {
36
+ display: flex;
37
+ align-items: center;
38
+ column-gap: 0.25em;
39
+ justify-content: center;
40
+ padding: 5px 10px;
41
+ color: var(--tab-item-color);
42
+ border-bottom: 1px solid transparent;
43
+ font-size: 0.875rem;
44
+ text-transform: uppercase;
45
+ transition: color 0.1s ease-in-out;
46
+ }
47
+ .uk-tab-left .ruk-switcher-trigger-button {
48
+ justify-content: left;
49
+ border-right: 2px solid transparent;
50
+ border-bottom: none;
51
+ width: 100%;
52
+ }
53
+ .uk-tab-right .ruk-switcher-trigger-button {
54
+ justify-content: right;
55
+ border-left: 2px solid transparent;
56
+ border-bottom: none;
57
+ width: 100%;
58
+ }
59
+ .uk-tab > * > button[disabled],
60
+ .uk-subnav > * > button[disabled] {
61
+ opacity: 0.5;
62
+ cursor: not-allowed;
63
+ }
64
+ .uk-tab > .uk-active > .ruk-switcher-trigger-button {
65
+ color: var(--tab-item-active-color);
66
+ border-color: var(--tab-item-active-border);
67
+ }
68
+ .uk-subnav-pill > .uk-active > .ruk-switcher-trigger-button {
69
+ background-color: var(--subnav-pill-item-active-background);
70
+ color: var(--subnav-pill-item-active-color);
71
+ }
72
+ .ruk-switcher-item.ruk-unstyled-button {
73
+ display: inline;
74
+ }
75
+ .ruk-accordion-trigger .uk-accordion-icon svg > [class*='line-'] {
76
+ transition: 0.2s ease-out;
77
+ transition-property: transform, opacity;
78
+ transform-origin: center;
79
+ }
80
+ .ruk-accordion-trigger[aria-expanded='true'] .uk-accordion-icon svg > .line-1 {
81
+ transform: rotate(-45deg);
82
+ opacity: 0;
83
+ }
84
+ .ruk-accordion-trigger[aria-expanded='true'] .uk-accordion-icon svg > .line-2 {
85
+ transform: rotate(90deg);
86
+ }
@@ -0,0 +1,16 @@
1
+ .ruk-accordion-trigger {
2
+ .uk-accordion-icon svg > [class*='line-'] {
3
+ transition: 0.2s ease-out;
4
+ transition-property: transform, opacity;
5
+ transform-origin: center;
6
+ }
7
+
8
+ &[aria-expanded='true'] .uk-accordion-icon svg > .line-1 {
9
+ transform: rotate(-45deg);
10
+ opacity: 0;
11
+ }
12
+
13
+ &[aria-expanded='true'] .uk-accordion-icon svg > .line-2 {
14
+ transform: rotate(90deg);
15
+ }
16
+ }
@@ -0,0 +1,66 @@
1
+ .uk-tab {
2
+ --tab-item-color: @global-muted-color;
3
+ --tab-item-active-color: @global-emphasis-color;
4
+ --tab-item-active-border: @global-primary-background;
5
+ }
6
+
7
+ .uk-subnav-pill {
8
+ --subnav-item-color: @global-muted-color;
9
+ --subnav-pill-item-active-color: @global-inverse-color;
10
+ --subnav-pill-item-active-background: @global-primary-background;
11
+ }
12
+
13
+ .ruk-switcher-list.uk-list > :nth-child(n + 2) {
14
+ margin-top: 0;
15
+ }
16
+
17
+ .ruk-switcher-list.uk-flex {
18
+ gap: var(--switcher-trigger-gutter, 5px);
19
+ }
20
+
21
+ .uk-tab .ruk-switcher-trigger-button {
22
+ display: flex;
23
+ align-items: center;
24
+ column-gap: 0.25em;
25
+ justify-content: center;
26
+ padding: 5px 10px;
27
+ color: var(--tab-item-color);
28
+ border-bottom: 1px solid transparent;
29
+ font-size: 0.875rem;
30
+ text-transform: uppercase;
31
+ transition: color 0.1s ease-in-out;
32
+ }
33
+
34
+ .uk-tab-left .ruk-switcher-trigger-button {
35
+ justify-content: left;
36
+ border-right: 2px solid transparent;
37
+ border-bottom: none;
38
+ width: 100%;
39
+ }
40
+
41
+ .uk-tab-right .ruk-switcher-trigger-button {
42
+ justify-content: right;
43
+ border-left: 2px solid transparent;
44
+ border-bottom: none;
45
+ width: 100%;
46
+ }
47
+
48
+ .uk-tab > * > button[disabled],
49
+ .uk-subnav > * > button[disabled] {
50
+ opacity: 0.5;
51
+ cursor: not-allowed;
52
+ }
53
+
54
+ .uk-tab > .uk-active > .ruk-switcher-trigger-button {
55
+ color: var(--tab-item-active-color);
56
+ border-color: var(--tab-item-active-border);
57
+ }
58
+
59
+ .uk-subnav-pill > .uk-active > .ruk-switcher-trigger-button {
60
+ background-color: var(--subnav-pill-item-active-background);
61
+ color: var(--subnav-pill-item-active-color);
62
+ }
63
+
64
+ .ruk-switcher-item.ruk-unstyled-button {
65
+ display: inline;
66
+ }
@@ -0,0 +1,19 @@
1
+ .ruk-unstyled-button {
2
+ text-align: center;
3
+ font: inherit;
4
+ color: inherit;
5
+ background: transparent;
6
+ border: none;
7
+ display: block;
8
+ margin: 0;
9
+ padding: 0;
10
+ cursor: pointer;
11
+
12
+ &:focus {
13
+ outline-offset: 2px;
14
+ }
15
+
16
+ &:focus:not(:focus-visible) {
17
+ outline: none;
18
+ }
19
+ }
@@ -0,0 +1,4 @@
1
+ @import (reference) 'uikit/src/less/uikit.theme.less'; /* vars only, no output */
2
+ @import './components/UnstyledButton/UnstyledButton.less';
3
+ @import './components/Switcher/Switcher.less';
4
+ @import './components/Accordion/Accordion.less';
package/package.json ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "@cyishere/react-uikit",
3
+ "version": "0.1.0",
4
+ "description": "React components for UIkit CSS framework",
5
+ "type": "module",
6
+ "author": "Chen Yang",
7
+ "license": "ISC",
8
+ "homepage": "https://github.com/cyishere/react-uikit#readme",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/cyishere/react-uikit.git",
12
+ "directory": "packages/react-uikit"
13
+ },
14
+ "bugs": {
15
+ "url": "https://github.com/cyishere/react-uikit/issues"
16
+ },
17
+ "keywords": [
18
+ "react",
19
+ "uikit",
20
+ "ui",
21
+ "components",
22
+ "component-library",
23
+ "css",
24
+ "ssr",
25
+ "accessibility"
26
+ ],
27
+ "main": "./dist/index.cjs",
28
+ "module": "./dist/index.js",
29
+ "types": "./dist/index.d.ts",
30
+ "exports": {
31
+ ".": {
32
+ "types": "./dist/index.d.ts",
33
+ "import": "./dist/index.js",
34
+ "require": "./dist/index.cjs"
35
+ },
36
+ "./styles.css": "./dist/styles.css",
37
+ "./less/*": "./less/*",
38
+ "./scss/*": "./scss/*"
39
+ },
40
+ "files": [
41
+ "dist",
42
+ "less",
43
+ "scss"
44
+ ],
45
+ "sideEffects": false,
46
+ "publishConfig": {
47
+ "access": "public"
48
+ },
49
+ "scripts": {
50
+ "build:js": "tsup",
51
+ "build:css": "node build/less.mjs",
52
+ "build:scss": "node build/prepare-styles.mjs",
53
+ "check:scss": "sass scss/index.scss /dev/null --no-source-map --load-path=node_modules --quiet-deps --silence-deprecation=import",
54
+ "build": "pnpm build:js && pnpm build:css && pnpm build:scss && pnpm check:scss",
55
+ "prepublishOnly": "pnpm build",
56
+ "dev": "tsup --watch",
57
+ "dev:styles": "node build/watch.mjs",
58
+ "test": "vitest",
59
+ "test:run": "vitest run",
60
+ "type-check": "tsc --noEmit"
61
+ },
62
+ "peerDependencies": {
63
+ "react": "^19.0.0",
64
+ "react-dom": "^19.0.0",
65
+ "uikit": "^3.0.0"
66
+ },
67
+ "devDependencies": {
68
+ "@testing-library/jest-dom": "^6.4.0",
69
+ "@testing-library/react": "^16.0.0",
70
+ "@testing-library/user-event": "^14.5.0",
71
+ "@types/react": "^19.0.0",
72
+ "@types/react-dom": "^19.0.0",
73
+ "@types/uikit": "^3.23.0",
74
+ "jsdom": "^25.0.0",
75
+ "less": "^4.6.6",
76
+ "react": "^19.0.0",
77
+ "react-dom": "^19.0.0",
78
+ "sass": "^1.99.0",
79
+ "tsup": "^8.3.0",
80
+ "uikit": "^3.25.16",
81
+ "vitest": "^2.1.0"
82
+ },
83
+ "dependencies": {
84
+ "@radix-ui/react-slot": "^1.2.4",
85
+ "react-focus-lock": "^2.13.7",
86
+ "react-remove-scroll": "^2.7.2"
87
+ }
88
+ }
@@ -0,0 +1,16 @@
1
+ .ruk-accordion-trigger {
2
+ .uk-accordion-icon svg > [class*='line-'] {
3
+ transition: 0.2s ease-out;
4
+ transition-property: transform, opacity;
5
+ transform-origin: center;
6
+ }
7
+
8
+ &[aria-expanded='true'] .uk-accordion-icon svg > .line-1 {
9
+ transform: rotate(-45deg);
10
+ opacity: 0;
11
+ }
12
+
13
+ &[aria-expanded='true'] .uk-accordion-icon svg > .line-2 {
14
+ transform: rotate(90deg);
15
+ }
16
+ }
@@ -0,0 +1,66 @@
1
+ .uk-tab {
2
+ --tab-item-color: #{$global-muted-color};
3
+ --tab-item-active-color: #{$global-emphasis-color};
4
+ --tab-item-active-border: #{$global-primary-background};
5
+ }
6
+
7
+ .uk-subnav-pill {
8
+ --subnav-item-color: #{$global-muted-color};
9
+ --subnav-pill-item-active-color: #{$global-inverse-color};
10
+ --subnav-pill-item-active-background: #{$global-primary-background};
11
+ }
12
+
13
+ .ruk-switcher-list.uk-list > :nth-child(n + 2) {
14
+ margin-top: 0;
15
+ }
16
+
17
+ .ruk-switcher-list.uk-flex {
18
+ gap: var(--switcher-trigger-gutter, 5px);
19
+ }
20
+
21
+ .uk-tab .ruk-switcher-trigger-button {
22
+ display: flex;
23
+ align-items: center;
24
+ column-gap: 0.25em;
25
+ justify-content: center;
26
+ padding: 5px 10px;
27
+ color: var(--tab-item-color);
28
+ border-bottom: 1px solid transparent;
29
+ font-size: 0.875rem;
30
+ text-transform: uppercase;
31
+ transition: color 0.1s ease-in-out;
32
+ }
33
+
34
+ .uk-tab-left .ruk-switcher-trigger-button {
35
+ justify-content: left;
36
+ border-right: 2px solid transparent;
37
+ border-bottom: none;
38
+ width: 100%;
39
+ }
40
+
41
+ .uk-tab-right .ruk-switcher-trigger-button {
42
+ justify-content: right;
43
+ border-left: 2px solid transparent;
44
+ border-bottom: none;
45
+ width: 100%;
46
+ }
47
+
48
+ .uk-tab > * > button[disabled],
49
+ .uk-subnav > * > button[disabled] {
50
+ opacity: 0.5;
51
+ cursor: not-allowed;
52
+ }
53
+
54
+ .uk-tab > .uk-active > .ruk-switcher-trigger-button {
55
+ color: var(--tab-item-active-color);
56
+ border-color: var(--tab-item-active-border);
57
+ }
58
+
59
+ .uk-subnav-pill > .uk-active > .ruk-switcher-trigger-button {
60
+ background-color: var(--subnav-pill-item-active-background);
61
+ color: var(--subnav-pill-item-active-color);
62
+ }
63
+
64
+ .ruk-switcher-item.ruk-unstyled-button {
65
+ display: inline;
66
+ }
@@ -0,0 +1,19 @@
1
+ .ruk-unstyled-button {
2
+ text-align: center;
3
+ font: inherit;
4
+ color: inherit;
5
+ background: transparent;
6
+ border: none;
7
+ display: block;
8
+ margin: 0;
9
+ padding: 0;
10
+ cursor: pointer;
11
+
12
+ &:focus {
13
+ outline-offset: 2px;
14
+ }
15
+
16
+ &:focus:not(:focus-visible) {
17
+ outline: none;
18
+ }
19
+ }
@@ -0,0 +1,4 @@
1
+ @import 'uikit/src/scss/variables-theme.scss'; /* vars only, no output */
2
+ @import './components/UnstyledButton/UnstyledButton.scss';
3
+ @import './components/Switcher/Switcher.scss';
4
+ @import './components/Accordion/Accordion.scss';