phoenix_duskmoon 5.1.0 → 6.0.2

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/CHANGELOG.md CHANGED
@@ -1,3 +1,123 @@
1
+ ## [6.0.2](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v6.0.1...v6.0.2) (2025-02-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * Fix Dockerfile and remove useless. ([f833766](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/f833766350b2ee557c77a573b9db54630b95b655))
7
+
8
+ ## [6.0.1](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v6.0.0...v6.0.1) (2025-02-05)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * Fix docs and ci. ([b98f34d](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/b98f34dacfd6f79c58ef1a837678190cddf64225))
14
+
15
+ # [6.0.0](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v5.1.0...v6.0.0) (2025-02-05)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * Fix button [@id](https://github.com/id). ([e544f0c](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/e544f0cd5dfc1f340f2bf0877c0532b7391a55d3))
21
+
22
+
23
+ ### Features
24
+
25
+ * Update Tailwind CSS to 4.0 ([#11](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/issues/11)) ([b2974a4](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/b2974a4915fd17df8784ef37dbeade1713ca89d3))
26
+
27
+
28
+ ### BREAKING CHANGES
29
+
30
+ * * Update tailwindcss to 4.0 and daisyui to 5.0.
31
+ * Remove legacy `use PhoenixDuskmoon`
32
+
33
+ # [5.2.0-beta.5](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v5.2.0-beta.4...v5.2.0-beta.5) (2025-02-05)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * Remove useless css. ([91d1682](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/91d16827299a23f13cc433e7aba742c3e02c1335))
39
+
40
+
41
+ ### Features
42
+
43
+ * Add theme. ([2f46764](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/2f46764a13f2dd49bbe9681a482658ac9a97448a))
44
+
45
+ # [5.2.0-beta.4](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v5.2.0-beta.3...v5.2.0-beta.4) (2025-02-05)
46
+
47
+
48
+ ### Bug Fixes
49
+
50
+ * Fix docs. ([39d9fb3](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/39d9fb3d24f94b536c517ccf4c1429c7b4cb1c69))
51
+ * Fix README.md. ([81ebcbf](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/81ebcbf5ef62e214def285516be132dc64001393))
52
+
53
+ # [5.2.0-beta.3](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v5.2.0-beta.2...v5.2.0-beta.3) (2025-02-04)
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * Fix storybook name. ([20ef181](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/20ef181df1b9892f5e5886220e23ebed4de0388b))
59
+ * Fix. ([a9bb7b4](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/a9bb7b45482ee54c158bf06e046b76c68a77a807))
60
+ * Fix. ([e16f8fd](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/e16f8fd8971be38143873bf901c167b6ac02d6b3))
61
+
62
+ # [5.2.0-beta.2](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v5.2.0-beta.1...v5.2.0-beta.2) (2025-02-04)
63
+
64
+
65
+ ### Bug Fixes
66
+
67
+ * Fix. ([a36d8b4](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/a36d8b44d205126774773b4135b65cb07baea9b5))
68
+
69
+ # [5.2.0-beta.1](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v5.1.0...v5.2.0-beta.1) (2025-02-04)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * Add fun spotlight. ([8fdd70e](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/8fdd70e259af9fa39bfd13f18b08a1a75cd8cb15))
75
+ * Add fun spotlight. ([693f6dd](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/693f6dd1bbfd01c89cb18438d010efe98d75c027))
76
+ * Fix atom and snow. ([5a6c85f](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/5a6c85fcbdebf4d47b87b212fc017564026e5b1a))
77
+ * Fix atom overflow. ([fc7753a](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/fc7753a1ed5df69bbfb3773cb0ff6d8fa1964ecd))
78
+ * Fix build. ([f80a79e](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/f80a79e5808625291570f73db3d5f55ef91e71fa))
79
+ * Fix build. ([51547e2](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/51547e2b68146381fb909da21b34ec203660cfea))
80
+ * Fix button [@id](https://github.com/id). ([1ca0bbc](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/1ca0bbc21da7ce213997fc6daa66e483678ff0ed))
81
+ * Fix button [@id](https://github.com/id). ([e544f0c](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/e544f0cd5dfc1f340f2bf0877c0532b7391a55d3))
82
+ * Fix ci version. ([7f2005e](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/7f2005e3c92061ddfe50e6081699ed4706f26a5e))
83
+ * Fix ci. ([75c4bcd](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/75c4bcdb79697279f8e155d750051fdaa003ceee))
84
+ * Fix ci. ([6085fcd](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/6085fcd1220bbba25322d4804fd59a065d8d4f3b))
85
+ * Fix ci. ([bf15d5d](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/bf15d5d66c72e62f3bb904adc72b4573704f4c2e))
86
+ * Fix gettext. ([c9a1419](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/c9a1419c53224128abeddd987092595005995301))
87
+ * Fix order. ([79d0b20](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/79d0b208b0535f271056692c5a5e2750ccbf59b0))
88
+ * Fix pagination. ([492b810](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/492b810047db09e420b2e7fa80927e32b163b7b2))
89
+ * Fix spotlight. ([71abaa3](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/71abaa3a7f75404462bb41007d299226ee94e2d0))
90
+ * Fix. ([c7839d7](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/c7839d79533e2aa77a9265c09003637174c3d385))
91
+ * Fix. ([ad83066](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/ad83066583e9513ab2550a8f5e9dc651b936a018))
92
+ * Fix. ([cc3f899](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/cc3f899791ca20b7be501d3b1038094f950d85e7))
93
+ * Fix. ([0617096](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/061709601de8ad750138ee755665135fd0c5ea34))
94
+ * Fix. ([7940600](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/79406000c0b3ab4ce2a7b6b56eb2aaca3417fca6))
95
+ * Fix. ([ab9fbd3](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/ab9fbd34162f8439f9030e576a3f7ec5659e4f86))
96
+ * Fix. ([2f4cfe4](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/2f4cfe4cdc7942326eb752fda9b9dce6845882c6))
97
+ * Fix. ([fc7cb0b](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/fc7cb0b49b7faff5e475cce15b52da0ec3ac5ef1))
98
+ * Fix. ([6e8366c](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/6e8366c21b3b6562137b17827a20d13f82307b11))
99
+ * Fix. ([7f0a6f0](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/7f0a6f0812d3f3255539aa28379f8f79daf34315))
100
+ * Fix. ([7edb06e](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/7edb06ee7c386cd1e47dd5bfb9bf7a2fec1bd152))
101
+ * Update bsi bootstrap icons. ([cb9354a](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/cb9354ad20c4d04303291f07af7319b4d959c059))
102
+ * Update mdi material design icons. ([598222a](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/598222a45081989bb9106d6f63ef544819b21203))
103
+ * Update new tailwind css. ([b9253df](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/b9253df07ccafdc87e05eb10dc91da21ba123866))
104
+ * Update tailwind and daisyui. ([5129da5](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/5129da5963bda3fa0047940946a73b62f42a4760))
105
+ * Use npm workspace. ([e5fa0a2](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/e5fa0a2254cee3f6071ee5da86692d5968479474))
106
+
107
+
108
+ ### Features
109
+
110
+ * add confirm slot to btn. ([c839278](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/c839278b8c61a5bd277dd340717efae65196931e))
111
+ * Add dm_compact_input. ([821849a](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/821849a5e5b2cd49e84d7526258e792609173d66))
112
+ * Add fun element. ([db3a22b](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/db3a22bcd881af1e8176b4ed5cc89a5a994befa0))
113
+
114
+ ## [5.1.1](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v5.1.0...v5.1.1) (2025-01-25)
115
+
116
+
117
+ ### Bug Fixes
118
+
119
+ * Fix button [@id](https://github.com/id). ([e544f0c](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/commit/e544f0cd5dfc1f340f2bf0877c0532b7391a55d3))
120
+
1
121
  # [5.1.0](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/compare/v5.0.6...v5.1.0) (2025-01-21)
2
122
 
3
123
 
package/README.md CHANGED
@@ -2,87 +2,50 @@
2
2
 
3
3
  [![release](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/actions/workflows/test-and-release.yml/badge.svg)](https://github.com/gsmlg-dev/phoenix-duskmoon-ui/actions/workflows/test-and-release.yml)
4
4
 
5
- Collection of helpers to generate and manipulate Web Component.
5
+ Provides Duskmoon UI for Phoenix project.
6
6
 
7
- Although this project was originally extracted from Phoenix,
8
- it does not depend on Phoenix and can be used with any Plug
9
- application (or even without Plug).
7
+ Require `tailwindcss >= 4.0` and `daisyui >= 5.0`
10
8
 
11
9
  See the [docs](https://hexdocs.pm/phoenix_duskmoon/) for more information.
12
10
 
13
- About at [Web Component](https://developer.mozilla.org/en-US/docs/Web/Web_Components)
14
11
 
15
12
  ## Install
16
13
 
17
14
  Add deps in `mix.exs`
18
15
  ```elixir
19
- {:phoenix_duskmoon, "~> 4.0"},
16
+ {:phoenix_duskmoon, "~> 6.0"},
20
17
  ```
21
18
 
22
19
  Include in phoenix view helpers
23
20
 
24
21
  ```elixir
25
- defp html_helpers do
26
- quote do
27
- # import all helper functions
28
- use PhoenixDuskmoon
29
-
30
- # or
31
- use PhoenixDuskmoon, :alias
32
- ...
33
- end
22
+ defp html_helpers do
23
+ quote do
24
+ # import all duskmoon ui component
25
+ use PhoenixDuskmoon.Component
26
+ # import all duskmoon ui fun component
27
+ use PhoenixDuskmoon.Fun
28
+ end
34
29
  end
35
30
  ```
36
31
 
37
- Include `javascript`
38
-
39
- ```javascript
40
- import 'phoenix_duskmoon';
41
- ```
42
-
43
- Web Componet library is now external
44
-
45
- ```bash
46
- npm install @gsmlg/lit
47
- ```
48
-
49
32
  Import `css`
50
33
 
51
34
  ```css
52
- @import 'phoenix_duskmoon/priv/static/phoenix_duskmoon.css';
53
- ```
54
-
55
- Use custom hook
35
+ @config "../tailwind.config.js";
56
36
 
57
- ```javascript
58
- import "phoenix_duskmoon";
59
- const WebComponentHook = window.__WebComponentHook__;
60
- const liveSocket = new LiveSocket("/live", Socket, {hooks: { WebComponentHook }});
61
- ```
62
-
63
- Send custom events to live view:
64
- ```html
65
- <Element darkmoon-send-sync-content="load_content" phx-hook="WebComponentHook" />
66
- <Element darkmoon-send-sync-content="load_content;loadAccepted" phx-hook="WebComponentHook" />
67
- ```
68
- - In the first element, when element trigger customEvents `sync-content`, also use `pushEvent` send `load_content` to live view.
69
- - Second element are same as first, but will call `loadAccepted` on element when receive server send feedback.
70
-
71
- Receive live view event:
72
- ```html
73
- <Element darkmoon-receive-update_content="updateContent" phx-hook="WebComponentHook" />
74
- <!-- equal -->
75
- <Element darkmoon-receive="update_content;updateContent" phx-hook="WebComponentHook" />
76
- ```
77
- - In this case, when live view fire `update_content` event, also trigger `updateContent` method on elmenet.
78
- - If value(`updateContent`) is empty, trigger a same event `update_content` on element.
79
-
80
- Import CSS
81
-
82
- ```css
83
- import "phoenix_duskmoon/priv/static/phoenix_duskmoon.css"
37
+ @import "tailwindcss";
38
+ @plugin "@tailwindcss/typography";
39
+ @plugin "daisyui";
40
+ @import "phoenix_duskmoon/theme";
41
+ @import "phoenix_duskmoon/components";
84
42
  ```
85
43
 
86
44
  ## Live Storybook
87
45
 
88
46
  [Live Storybook](https://duskmoon-storybook.gsmlg.dev)
47
+
48
+ ![](screenshots/1.png)
49
+ ![](screenshots/2.png)
50
+ ![](screenshots/3.png)
51
+ ![](screenshots/4.png)
@@ -0,0 +1,168 @@
1
+
2
+ @layer components {
3
+ .atom {
4
+ --atom-size: 360px;
5
+ --atom-color: #00d8ff;
6
+ --nucleus-size: calc(var(--atom-size) / 5);
7
+ --electron-color: #99f8ff;
8
+ --electron-size : calc(var(--atom-size) / 25);
9
+ --electron-orbit-size : calc(var(--atom-size) / 2.5);
10
+ --electron-speed : 1.2s;
11
+ --electron-speed-alpha : 1s;
12
+ --electron-speed-omega : .8s;
13
+ position: relative;
14
+ width: var(--atom-size);
15
+ height: var(--atom-size);
16
+ animation: 8s atom infinite cubic-bezier(1, .25, 0, .75);
17
+ box-sizing: border-box;
18
+ overflow: hidden;
19
+
20
+ *, *:before, *::after {
21
+ box-sizing: border-box;
22
+ }
23
+ }
24
+ @keyframes atom {
25
+ 0% { transform: rotate(0deg) scale(1); }
26
+ 12.5% { transform: rotate(-45deg) scale(.9); }
27
+ 25% { transform: rotate(-90deg) scale(1); }
28
+ 37.5% { transform: rotate(-135deg) scale(.9); }
29
+ 50% { transform: rotate(-180deg) scale(1); }
30
+ 62.5% { transform: rotate(-225deg) scale(.9); }
31
+ 75% { transform: rotate(-270deg) scale(1); }
32
+ 87.5% { transform: rotate(-315deg) scale(.9); }
33
+ 100% { transform: rotate(-360deg) scale(1); }
34
+ }
35
+
36
+ .atom::before {
37
+ content: '';
38
+ display: block;
39
+ position: absolute;
40
+ top: 50%;
41
+ left: 50%;
42
+ width: var(--nucleus-size);
43
+ height: var(--nucleus-size);
44
+ margin-top: calc(var(--nucleus-size) / -2);
45
+ margin-left: calc(var(--nucleus-size) / -2);
46
+ background: color-mix(in srgb, var(--atom-color) 70%, transparent);
47
+ border-radius: 100%;
48
+ box-shadow: 0 0 3px 0 color-mix(in srgb, var(--atom-color) 70%, transparent);
49
+ animation: 2s nucleus infinite cubic-bezier(.65, 0, .35, 1);
50
+ }
51
+ @keyframes nucleus {
52
+ 0% { transform: scale(1); }
53
+ 25% { transform: scale(.9); }
54
+ 50% { transform: scale(1); }
55
+ 75% { transform: scale(.85); }
56
+ 100% { transform: scale(1); }
57
+ }
58
+
59
+ .atom > [class^="electron"] {
60
+ border-top: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 1px;
61
+ border-right: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 2px;
62
+ border-bottom: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 4px;
63
+ border-left: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 2px;
64
+ border-radius: 100%;
65
+ width: 100%;
66
+ height: var(--electron-orbit-size);
67
+ position: absolute;
68
+ top: 50%;
69
+ margin-top: calc(var(--electron-orbit-size) / -2);
70
+ animation: var(--electron-speed) electron-orbit infinite linear;
71
+ }
72
+ .atom > .electron-alpha {
73
+ transform: rotate(60deg);
74
+ animation: var(--electron-speed-alpha) electron-orbit infinite linear;
75
+ }
76
+ .atom > .electron-omega {
77
+ transform: rotate(-60deg);
78
+ animation: var(--electron-speed-omega) electron-orbit infinite linear;
79
+ }
80
+ @keyframes electron-orbit {
81
+ 0% {
82
+ border-top: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 1px;
83
+ border-right: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 2px;
84
+ border-bottom: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 4px;
85
+ border-left: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 2px;
86
+ }
87
+ 25% {
88
+ border-top: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 1px;
89
+ border-right: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 2px;
90
+ border-bottom: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 4px;
91
+ border-left: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 2px;
92
+ }
93
+ 50% {
94
+ border-top: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 1px;
95
+ border-right: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 2px;
96
+ border-bottom: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 4px;
97
+ border-left: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 2px;
98
+ }
99
+ 75% {
100
+ border-top: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 1px;
101
+ border-right: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 2px;
102
+ border-bottom: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 4px;
103
+ border-left: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 2px;
104
+ }
105
+ 100% {
106
+ border-top: solid color-mix(in srgb, var(--atom-color) 50%, transparent) 1px;
107
+ border-right: solid color-mix(in srgb, var(--atom-color) 35%, transparent) 2px;
108
+ border-bottom: solid color-mix(in srgb, var(--atom-color) 20%, transparent) 4px;
109
+ border-left: solid color-mix(in srgb, var(--atom-color) 0%, transparent) 2px;
110
+ }
111
+ }
112
+
113
+ .atom [class^="electron"]::after {
114
+ content: '';
115
+ display: block;
116
+ width: var(--electron-size);
117
+ height: var(--electron-size);
118
+ background: var(--electron-color);
119
+ border-radius: 50%;
120
+ margin-top: calc(var(--electron-size) / -2);
121
+ position: absolute;
122
+ top: 50%;
123
+ left: calc(var(--electron-size) / -1);
124
+ transform: scale(1);
125
+ animation: calc(var(--electron-speed) * 2) electron infinite ease-in-out;
126
+ }
127
+ .atom .electron-alpha::after { animation: calc(var(--electron-speed-alpha) * 2) electron infinite ease-in-out; }
128
+ .atom .electron-omega::after { animation: calc(var(--electron-speed-omega) * 2) electron infinite ease-in-out; }
129
+ @keyframes electron {
130
+ 0% {
131
+ left: calc(var(--electron-size) / -1);
132
+ transform: scale(1);
133
+ }
134
+ 12.5% {
135
+ top: 100%;
136
+ transform: scale(1.5);
137
+ }
138
+ 25% {
139
+ left: 100%;
140
+ transform: scale(1);
141
+ }
142
+ 37.5% {
143
+ top: 0%;
144
+ transform: scale(.25);
145
+ }
146
+ 50% {
147
+ left: calc(var(--electron-size) / -1);
148
+ transform: scale(1);
149
+ }
150
+ 62.5% {
151
+ top: 100%;
152
+ transform: scale(1.5);
153
+ }
154
+ 75% {
155
+ left: 100%;
156
+ transform: scale(1);
157
+ }
158
+ 87.5% {
159
+ top: 0%;
160
+ transform: scale(.25);
161
+ }
162
+ 100% {
163
+ left: calc(var(--electron-size) / -1);
164
+ transform: scale(1);
165
+ }
166
+ }
167
+
168
+ }