bootstrap-time 0.1.0 → 0.1.1

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 M. de Ridder
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 M. de Ridder
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/README.md CHANGED
@@ -1,47 +1,47 @@
1
- # bootstrap-time
2
-
3
- Analog clock based on Bootstrap.
4
-
5
- The package is available on [npm](https://www.npmjs.com/package/bootstrap-time) and [jsDelivr](https://www.jsdelivr.com/package/npm/bootstrap-time).
6
-
7
- ## What's included
8
-
9
- ```
10
- src/ source
11
- js/bootstrap-time.js script entrypoint
12
- scss/bootstrap-time.scss style entrypoint
13
- dist/ generated, do not edit
14
- css/bootstrap-time.css
15
- css/bootstrap-time.min.css
16
- js/bootstrap-time.js
17
- js/bootstrap-time.min.js
18
- examples/ HTML that points at dist
19
- ```
20
-
21
- `npm run build` compiles `src` into `dist`. Bootstrap 6 is required. The time field uses [form adornments](https://getbootstrap.com/docs/6.0/forms/form-adorn/), which Bootstrap 5.3 does not have. Bootstrap 5.3 can only place an addon beside the input with `input-group`, not inside it. The clock icon comes from bootstrap-icons.
22
-
23
- ## Usage
24
-
25
- Install from npm:
26
-
27
- ```bash
28
- npm install bootstrap-time bootstrap@6 bootstrap-icons
29
- ```
30
-
31
- Or load the published files from jsDelivr:
32
-
33
- ```html
34
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
35
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.2/font/bootstrap-icons.min.css">
36
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-time@0.1.0/dist/css/bootstrap-time.min.css">
37
- <script src="https://cdn.jsdelivr.net/npm/bootstrap-time@0.1.0/dist/js/bootstrap-time.min.js"></script>
38
- ```
39
-
40
- Local builds use the same paths under `dist/`:
41
-
42
- ```html
43
- <link rel="stylesheet" href="dist/css/bootstrap-time.min.css">
44
- <script src="dist/js/bootstrap-time.min.js"></script>
45
- ```
46
-
47
- The script initializes the clock when `.clock-picker`, `#clock`, `#time-input`, `#hour-arrow` and `#minute-arrow` are present. The widget overlays the form under the time input. See `examples/bootstrap-time.html`.
1
+ # bootstrap-time
2
+
3
+ Analog clock based on Bootstrap.
4
+
5
+ The package is available on [npm](https://www.npmjs.com/package/bootstrap-time) and [jsDelivr](https://www.jsdelivr.com/package/npm/bootstrap-time).
6
+
7
+ ## What's included
8
+
9
+ ```
10
+ src/ source
11
+ js/bootstrap-time.js script entrypoint
12
+ scss/bootstrap-time.scss style entrypoint
13
+ dist/ generated, do not edit
14
+ css/bootstrap-time.css
15
+ css/bootstrap-time.min.css
16
+ js/bootstrap-time.js
17
+ js/bootstrap-time.min.js
18
+ examples/ HTML that points at dist
19
+ ```
20
+
21
+ `npm run build` compiles `src` into `dist`. Bootstrap 6 is required. The time field uses [form adornments](https://getbootstrap.com/docs/6.0/forms/form-adorn/), which Bootstrap 5.3 does not have. Bootstrap 5.3 can only place an addon beside the input with `input-group`, not inside it. The clock icon comes from bootstrap-icons.
22
+
23
+ ## Usage
24
+
25
+ Install from npm:
26
+
27
+ ```bash
28
+ npm install bootstrap-time bootstrap@6 bootstrap-icons
29
+ ```
30
+
31
+ Or load the published files from jsDelivr:
32
+
33
+ ```html
34
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@6.0.0-alpha.1/dist/css/bootstrap.min.css">
35
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.2/font/bootstrap-icons.min.css">
36
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-time@0.1.1/dist/css/bootstrap-time.min.css">
37
+ <script src="https://cdn.jsdelivr.net/npm/bootstrap-time@0.1.1/dist/js/bootstrap-time.min.js"></script>
38
+ ```
39
+
40
+ Local builds use the same paths under `dist/`:
41
+
42
+ ```html
43
+ <link rel="stylesheet" href="dist/css/bootstrap-time.min.css">
44
+ <script src="dist/js/bootstrap-time.min.js"></script>
45
+ ```
46
+
47
+ The script initializes the clock when `.clock-picker`, `#clock`, `#time-input`, `#hour-arrow` and `#minute-arrow` are present. The widget overlays the form under the time input. See `examples/bootstrap-time.html`.
@@ -1,120 +1,120 @@
1
- .clock-picker {
2
- position: relative;
3
- width: 20rem;
4
- }
5
- .clock-picker input[type=time]::-webkit-calendar-picker-indicator {
6
- display: none;
7
- appearance: none;
8
- }
9
-
10
- .clock-toggle {
11
- pointer-events: auto;
12
- width: 2.25rem;
13
- height: 2.25rem;
14
- margin: -0.25rem;
15
- border: 0;
16
- border-radius: 50%;
17
- background: transparent;
18
- color: var(--bs-form-adorn-icon-color, var(--bs-secondary-color));
19
- }
20
- .clock-toggle .bi {
21
- font-size: 1rem;
22
- line-height: 1;
23
- }
24
- .clock-toggle:hover, .clock-toggle:focus-visible {
25
- background-color: var(--bs-bg-3);
26
- color: var(--bs-body-color);
27
- }
28
-
29
- .clock-widget {
30
- position: absolute;
31
- top: 100%;
32
- left: 0;
33
- z-index: 5;
34
- width: 20rem;
35
- margin-top: 0.25rem;
36
- padding: 0.25rem 0.5rem 1rem;
37
- background-color: var(--bs-secondary-bg-subtle);
38
- color: var(--bs-secondary-fg);
39
- }
40
-
41
- .clock-arrows {
42
- display: flex;
43
- justify-content: flex-end;
44
- gap: 0.25rem;
45
- }
46
-
47
- .btn.clock-arrow {
48
- display: inline-flex;
49
- align-items: center;
50
- justify-content: center;
51
- width: 2rem;
52
- height: 2rem;
53
- min-height: 0;
54
- padding: 0;
55
- border-radius: 50%;
56
- background-color: transparent;
57
- color: var(--bs-body-color);
58
- text-decoration: none;
59
- }
60
- .btn.clock-arrow svg {
61
- width: 1.5rem;
62
- height: 1.5rem;
63
- fill: currentColor;
64
- }
65
- .btn.clock-arrow:hover, .btn.clock-arrow:focus-visible {
66
- background-color: var(--bs-bg-3);
67
- color: var(--bs-body-color);
68
- }
69
- .btn.clock-arrow:disabled, .btn.clock-arrow:disabled:hover {
70
- background-color: transparent;
71
- color: var(--bs-secondary-color);
72
- opacity: 0.45;
73
- }
74
-
75
- .clock {
76
- width: 16rem;
77
- height: 16rem;
78
- border-radius: 50%;
79
- }
80
-
81
- .clock-hand {
82
- position: absolute;
83
- left: 50%;
84
- bottom: 50%;
85
- width: 2px;
86
- height: var(--hand);
87
- transform-origin: center bottom;
88
- transform: translateX(-50%) rotate(var(--angle));
89
- transition: transform 0.3s ease, height 0.3s ease;
90
- border-radius: 1px;
91
- pointer-events: none;
92
- }
93
-
94
- .clock-knob {
95
- position: absolute;
96
- left: 50%;
97
- top: 0;
98
- width: 2.25rem;
99
- height: 2.25rem;
100
- border-radius: 50%;
101
- transform: translate(-50%, -50%);
102
- }
103
-
104
- .clock-number {
105
- position: absolute;
106
- left: 50%;
107
- top: 50%;
108
- z-index: 1;
109
- width: 2.25rem;
110
- height: 2.25rem;
111
- margin: -1.125rem;
112
- border: 0;
113
- border-radius: 50%;
114
- background: transparent;
115
- color: inherit;
116
- transform: rotate(var(--angle)) translateY(calc(var(--radius) * -1)) rotate(calc(var(--angle) * -1));
117
- }
118
- .clock-number[aria-pressed=true] {
119
- color: var(--bs-white, #fff);
120
- }
1
+ .clock-picker {
2
+ position: relative;
3
+ width: 20rem;
4
+ }
5
+ .clock-picker input[type=time]::-webkit-calendar-picker-indicator {
6
+ display: none;
7
+ appearance: none;
8
+ }
9
+
10
+ .clock-toggle {
11
+ pointer-events: auto;
12
+ width: 2.25rem;
13
+ height: 2.25rem;
14
+ margin: -0.25rem;
15
+ border: 0;
16
+ border-radius: 50%;
17
+ background: transparent;
18
+ color: var(--bs-form-adorn-icon-color, var(--bs-secondary-color));
19
+ }
20
+ .clock-toggle .bi {
21
+ font-size: 1rem;
22
+ line-height: 1;
23
+ }
24
+ .clock-toggle:hover, .clock-toggle:focus-visible {
25
+ background-color: var(--bs-bg-3);
26
+ color: var(--bs-body-color);
27
+ }
28
+
29
+ .clock-widget {
30
+ position: absolute;
31
+ top: 100%;
32
+ left: 0;
33
+ z-index: 5;
34
+ width: 20rem;
35
+ margin-top: 0.25rem;
36
+ padding: 0.25rem 0.5rem 1rem;
37
+ background-color: var(--bs-secondary-bg-subtle);
38
+ color: var(--bs-secondary-fg);
39
+ }
40
+
41
+ .clock-arrows {
42
+ display: flex;
43
+ justify-content: flex-end;
44
+ gap: 0.25rem;
45
+ }
46
+
47
+ .btn.clock-arrow {
48
+ display: inline-flex;
49
+ align-items: center;
50
+ justify-content: center;
51
+ width: 2rem;
52
+ height: 2rem;
53
+ min-height: 0;
54
+ padding: 0;
55
+ border-radius: 50%;
56
+ background-color: transparent;
57
+ color: var(--bs-body-color);
58
+ text-decoration: none;
59
+ }
60
+ .btn.clock-arrow svg {
61
+ width: 1.5rem;
62
+ height: 1.5rem;
63
+ fill: currentColor;
64
+ }
65
+ .btn.clock-arrow:hover, .btn.clock-arrow:focus-visible {
66
+ background-color: var(--bs-bg-3);
67
+ color: var(--bs-body-color);
68
+ }
69
+ .btn.clock-arrow:disabled, .btn.clock-arrow:disabled:hover {
70
+ background-color: transparent;
71
+ color: var(--bs-secondary-color);
72
+ opacity: 0.45;
73
+ }
74
+
75
+ .clock {
76
+ width: 16rem;
77
+ height: 16rem;
78
+ border-radius: 50%;
79
+ }
80
+
81
+ .clock-hand {
82
+ position: absolute;
83
+ left: 50%;
84
+ bottom: 50%;
85
+ width: 2px;
86
+ height: var(--hand);
87
+ transform-origin: center bottom;
88
+ transform: translateX(-50%) rotate(var(--angle));
89
+ transition: transform 0.3s ease, height 0.3s ease;
90
+ border-radius: 1px;
91
+ pointer-events: none;
92
+ }
93
+
94
+ .clock-knob {
95
+ position: absolute;
96
+ left: 50%;
97
+ top: 0;
98
+ width: 2.25rem;
99
+ height: 2.25rem;
100
+ border-radius: 50%;
101
+ transform: translate(-50%, -50%);
102
+ }
103
+
104
+ .clock-number {
105
+ position: absolute;
106
+ left: 50%;
107
+ top: 50%;
108
+ z-index: 1;
109
+ width: 2.25rem;
110
+ height: 2.25rem;
111
+ margin: -1.125rem;
112
+ border: 0;
113
+ border-radius: 50%;
114
+ background: transparent;
115
+ color: inherit;
116
+ transform: rotate(var(--angle)) translateY(calc(var(--radius) * -1)) rotate(calc(var(--angle) * -1));
117
+ }
118
+ .clock-number[aria-pressed=true] {
119
+ color: var(--bs-white, #fff);
120
+ }
@@ -1 +1 @@
1
- .clock-picker{position:relative;width:20rem}.clock-picker input[type=time]::-webkit-calendar-picker-indicator{display:none;appearance:none}.clock-toggle{pointer-events:auto;width:2.25rem;height:2.25rem;margin:-0.25rem;border:0;border-radius:50%;background:rgba(0,0,0,0);color:var(--bs-form-adorn-icon-color, var(--bs-secondary-color))}.clock-toggle .bi{font-size:1rem;line-height:1}.clock-toggle:hover,.clock-toggle:focus-visible{background-color:var(--bs-bg-3);color:var(--bs-body-color)}.clock-widget{position:absolute;top:100%;left:0;z-index:5;width:20rem;margin-top:.25rem;padding:.25rem .5rem 1rem;background-color:var(--bs-secondary-bg-subtle);color:var(--bs-secondary-fg)}.clock-arrows{display:flex;justify-content:flex-end;gap:.25rem}.btn.clock-arrow{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;min-height:0;padding:0;border-radius:50%;background-color:rgba(0,0,0,0);color:var(--bs-body-color);text-decoration:none}.btn.clock-arrow svg{width:1.5rem;height:1.5rem;fill:currentColor}.btn.clock-arrow:hover,.btn.clock-arrow:focus-visible{background-color:var(--bs-bg-3);color:var(--bs-body-color)}.btn.clock-arrow:disabled,.btn.clock-arrow:disabled:hover{background-color:rgba(0,0,0,0);color:var(--bs-secondary-color);opacity:.45}.clock{width:16rem;height:16rem;border-radius:50%}.clock-hand{position:absolute;left:50%;bottom:50%;width:2px;height:var(--hand);transform-origin:center bottom;transform:translateX(-50%) rotate(var(--angle));transition:transform .3s ease,height .3s ease;border-radius:1px;pointer-events:none}.clock-knob{position:absolute;left:50%;top:0;width:2.25rem;height:2.25rem;border-radius:50%;transform:translate(-50%, -50%)}.clock-number{position:absolute;left:50%;top:50%;z-index:1;width:2.25rem;height:2.25rem;margin:-1.125rem;border:0;border-radius:50%;background:rgba(0,0,0,0);color:inherit;transform:rotate(var(--angle)) translateY(calc(var(--radius) * -1)) rotate(calc(var(--angle) * -1))}.clock-number[aria-pressed=true]{color:var(--bs-white, #fff)}
1
+ .clock-picker{position:relative;width:20rem}.clock-picker input[type=time]::-webkit-calendar-picker-indicator{display:none;appearance:none}.clock-toggle{pointer-events:auto;width:2.25rem;height:2.25rem;margin:-0.25rem;border:0;border-radius:50%;background:rgba(0,0,0,0);color:var(--bs-form-adorn-icon-color, var(--bs-secondary-color))}.clock-toggle .bi{font-size:1rem;line-height:1}.clock-toggle:hover,.clock-toggle:focus-visible{background-color:var(--bs-bg-3);color:var(--bs-body-color)}.clock-widget{position:absolute;top:100%;left:0;z-index:5;width:20rem;margin-top:.25rem;padding:.25rem .5rem 1rem;background-color:var(--bs-secondary-bg-subtle);color:var(--bs-secondary-fg)}.clock-arrows{display:flex;justify-content:flex-end;gap:.25rem}.btn.clock-arrow{display:inline-flex;align-items:center;justify-content:center;width:2rem;height:2rem;min-height:0;padding:0;border-radius:50%;background-color:rgba(0,0,0,0);color:var(--bs-body-color);text-decoration:none}.btn.clock-arrow svg{width:1.5rem;height:1.5rem;fill:currentColor}.btn.clock-arrow:hover,.btn.clock-arrow:focus-visible{background-color:var(--bs-bg-3);color:var(--bs-body-color)}.btn.clock-arrow:disabled,.btn.clock-arrow:disabled:hover{background-color:rgba(0,0,0,0);color:var(--bs-secondary-color);opacity:.45}.clock{width:16rem;height:16rem;border-radius:50%}.clock-hand{position:absolute;left:50%;bottom:50%;width:2px;height:var(--hand);transform-origin:center bottom;transform:translateX(-50%) rotate(var(--angle));transition:transform .3s ease,height .3s ease;border-radius:1px;pointer-events:none}.clock-knob{position:absolute;left:50%;top:0;width:2.25rem;height:2.25rem;border-radius:50%;transform:translate(-50%, -50%)}.clock-number{position:absolute;left:50%;top:50%;z-index:1;width:2.25rem;height:2.25rem;margin:-1.125rem;border:0;border-radius:50%;background:rgba(0,0,0,0);color:inherit;transform:rotate(var(--angle)) translateY(calc(var(--radius) * -1)) rotate(calc(var(--angle) * -1))}.clock-number[aria-pressed=true]{color:var(--bs-white, #fff)}