Skip to content

Commit 6b89685

Browse files
authored
Merge branch 'v1/contrib' into feature/color-slider-advanced
2 parents 25d72d4 + df8b8b0 commit 6b89685

File tree

11 files changed

+1961
-1056
lines changed

11 files changed

+1961
-1056
lines changed

package-lock.json

Lines changed: 1851 additions & 1035 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@
6363
"@chromatic-com/storybook": "^3.2.6",
6464
"@eslint/compat": "1.2.8",
6565
"@eslint/js": "9.24.0",
66-
"@lerna-lite/cli": "3.12.3",
67-
"@lerna-lite/exec": "3.12.3",
68-
"@lerna-lite/publish": "3.12.3",
69-
"@lerna-lite/run": "3.12.3",
70-
"@lerna-lite/version": "3.12.3",
66+
"@lerna-lite/cli": "4.1.1",
67+
"@lerna-lite/exec": "4.1.1",
68+
"@lerna-lite/publish": "4.1.1",
69+
"@lerna-lite/run": "4.1.1",
70+
"@lerna-lite/version": "4.1.1",
7171
"@open-wc/testing": "4.0.0",
7272
"@rollup/plugin-node-resolve": "15.2.3",
7373
"@storybook/addon-a11y": "^8.6.12",
@@ -134,7 +134,7 @@
134134
"turbo": "2.4.4",
135135
"typescript": "5.8.2",
136136
"typescript-eslint": "8.26.0",
137-
"vite": "6.2.6",
137+
"vite": "6.3.4",
138138
"vite-plugin-turbosnap": "1.0.3",
139139
"vite-tsconfig-paths": "5.1.4",
140140
"web-component-analyzer": "2.0.0"

packages/uui-base/lib/utils/drag.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ export const drag = (
2525
// TouchEvent is not available in Firefox
2626
if ('TouchEvent' in window && event instanceof TouchEvent) {
2727
pointerEvent = event.touches[0];
28-
} else if (event instanceof PointerEvent) {
28+
} else if (event instanceof MouseEvent) {
29+
// Some browsers seem to return PointerEvent instead of MouseEvent for click event.
30+
// We can use MouseEvent as PointerEvent inherits from MouseEvent.
31+
// Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1675847
32+
// Safari: https://bugs.webkit.org/show_bug.cgi?id=218665
2933
pointerEvent = event;
3034
} else {
3135
return;

packages/uui-button-copy-text/lib/uui-button-copy-text.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class UUIButtonCopyTextElement extends UUIButtonElement {
7373
const el = document.getElementById(this.copyFrom);
7474
if (el) {
7575
// Override the value to copy, if the element has a value property
76-
// Such as uui-input or uui-textarea or native inout elements
76+
// Such as uui-input or uui-textarea or native input elements
7777
if ('value' in el) {
7878
valueToCopy = (el as any).value;
7979
} else {

packages/uui-color-swatch/lib/uui-color-swatch.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export class UUIColorSwatchElement extends LabelMixin(
129129
<div class="color-swatch color-swatch--transparent-bg">
130130
<div
131131
class="color-swatch__color"
132-
style="background-color: var(--uui-swatch-color, ${this.color ??
132+
style="background: var(--uui-swatch-color, ${this.color ??
133133
this.value})"></div>
134134
<div
135135
class="color-swatch__check"

packages/uui-color-swatch/lib/uui-color-swatch.story.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,12 @@ export const Transparent: Story = {
114114
value: 'rgba(209, 2, 26, 0.4)',
115115
},
116116
};
117+
118+
export const Gradient: Story = {
119+
args: {
120+
value: 'sun',
121+
color: 'radial-gradient(orange, red)',
122+
label: 'Sun',
123+
showLabel: true,
124+
},
125+
};

packages/uui-color-swatches/lib/uui-color-swatches.story.ts

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,57 @@ import type { Meta, StoryObj } from '@storybook/web-components';
55
import { spread } from '../../../storyhelpers';
66
import { repeat } from 'lit/directives/repeat.js';
77

8-
const swatchesColor = [
8+
const swatches = [
99
{ label: 'Blood Orange', value: '#d0021b' },
1010
{ label: 'Avocado', value: '#417505' },
1111
{ label: 'Tufts Blue', value: '#4a90e2' },
1212
];
1313

14+
const gradients = [
15+
{
16+
label: 'Vital Ocean',
17+
value: 'ocean',
18+
color:
19+
'linear-gradient(90deg,rgba(2, 0, 36, 1) 0%, rgba(9, 9, 121, 1) 35%, rgba(0, 212, 255, 1) 100%)',
20+
},
21+
{
22+
label: 'Disco Club',
23+
value: 'avocado',
24+
color:
25+
'radial-gradient(circle,rgba(63, 94, 251, 1) 0%, rgba(252, 70, 107, 1) 100%)',
26+
},
27+
{
28+
label: 'Deep Sunset',
29+
value: 'sunset',
30+
color:
31+
'linear-gradient(90deg,rgba(131, 58, 180, 1) 0%, rgba(253, 29, 29, 1) 50%, rgba(252, 176, 69, 1) 100%)',
32+
},
33+
{
34+
label: 'Bubble Gum',
35+
value: 'gum',
36+
color:
37+
'radial-gradient(circle,rgba(238, 174, 202, 1) 0%, rgba(148, 187, 233, 1) 100%)',
38+
},
39+
{
40+
label: 'Blue Lagoon',
41+
value: 'lagoon',
42+
color:
43+
'linear-gradient(90deg,rgba(67, 198, 172, 1) 0%, rgba(25, 22, 84, 1) 100%)',
44+
},
45+
{
46+
label: 'Lemon Twist',
47+
value: 'lemon-twist',
48+
color:
49+
'linear-gradient(90deg,rgba(60, 165, 92, 1) 0%, rgba(181, 172, 73, 1) 100%)',
50+
},
51+
];
52+
1453
const meta: Meta = {
1554
id: 'uui-color-swatches',
1655
component: 'uui-color-swatches',
1756
title: 'Inputs/Color/Color Swatches',
1857
args: {
19-
swatches: swatchesColor,
58+
swatches: swatches,
2059
},
2160
argTypes: {
2261
value: { control: { type: 'color' } },
@@ -26,14 +65,17 @@ const meta: Meta = {
2665
render: (args: any) => html`
2766
<uui-color-swatches
2867
${spread(args, ['swatches', 'showLabel'])}
29-
label="My color pallette">${repeat(args.swatches, (swatch: any) => {
68+
label="My color palette">${repeat(args.swatches, (swatch: any) => {
3069
const label = typeof swatch === 'string' ? swatch : swatch.label;
3170
const value = typeof swatch === 'string' ? swatch : swatch.value;
71+
const color = typeof swatch === 'string' ? swatch : swatch.color;
3272
return html`
3373
<uui-color-swatch
3474
label="${label}"
3575
.showLabel=${args.showLabel}
36-
.value=${value}></uui-color-swatch>`;
76+
.color="${color}"
77+
.value=${value}>
78+
</uui-color-swatch>`;
3779
})}
3880
</uui-color-swatches>
3981
`,
@@ -72,3 +114,11 @@ export const ShowLabel: Story = {
72114
showLabel: true,
73115
},
74116
};
117+
118+
export const Gradient: Story = {
119+
args: {
120+
swatches: gradients,
121+
showLabel: true,
122+
value: 'lemon-twist',
123+
},
124+
};

packages/uui-input/lib/uui-input.element.ts

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ export type InputType =
2424
| 'number'
2525
| 'color';
2626

27+
export type InputMode =
28+
| 'text'
29+
| 'none'
30+
| 'decimal'
31+
| 'numeric'
32+
| 'tel'
33+
| 'search'
34+
| 'email'
35+
| 'url';
36+
2737
/**
2838
* Custom element wrapping the native input element.This is a formAssociated element, meaning it can participate in a native HTMLForm. A name:value pair will be submitted.
2939
* @element uui-input
@@ -169,7 +179,8 @@ export class UUIInputElement extends UUIFormControlMixin(
169179

170180
/**
171181
* This property specifies the type of input that will be rendered.
172-
* @type {'text' | 'tel'| 'url'| 'email'| 'password'| 'date'| 'month'| 'week'| 'time'| 'datetime-local'| 'number'| 'color'}
182+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#input_types|MDN} for further information
183+
* @type {'text' | 'tel' | 'url' | 'email' | 'password' | 'date' | 'month' | 'week' | 'time' | 'datetime-local' | 'number' | 'color'}
173184
* @attr
174185
* @default text
175186
*/
@@ -182,21 +193,22 @@ export class UUIInputElement extends UUIFormControlMixin(
182193
}
183194

184195
/**
185-
* Validates the input based on the Regex pattern
186-
* @type {string}
196+
* The inputmode global attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard.
197+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode|MDN} for further information
198+
* @type {'text' | 'none' | 'decimal' | 'number' | 'tel' | 'search' | 'email' | 'url'}
187199
* @attr
200+
* @default text
188201
*/
189-
@property({ type: String })
190-
pattern?: string;
202+
@property({ attribute: 'inputmode' })
203+
inputMode: InputMode = 'text';
191204

192205
/**
193-
* The inputmode global attribute is an enumerated attribute that hints at the type of data that might be entered by the user while editing the element or its contents. This allows a browser to display an appropriate virtual keyboard.
194-
* @see {@link https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode|MDN} for further information
206+
* Validates the input based on the Regex pattern
195207
* @type {string}
196208
* @attr
197209
*/
198210
@property({ type: String })
199-
inputMode = '';
211+
pattern?: string;
200212

201213
@query('#input')
202214
_input!: HTMLInputElement;

packages/uui-input/lib/uui-input.story.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ const meta: Meta = {
3232
'color',
3333
],
3434
},
35+
inputMode: {
36+
options: [
37+
'text',
38+
'none',
39+
'decimal',
40+
'numeric',
41+
'tel',
42+
'search',
43+
'email',
44+
'url',
45+
],
46+
},
3547
},
3648
parameters: {
3749
readme: {

packages/uui-modal/lib/uui-modal-dialog.element.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class UUIModalDialogElement extends UUIModalElement {
1616
...UUIModalElement.styles,
1717
css`
1818
:host {
19+
outline: none;
1920
--uui-modal-dialog-background: var(--uui-color-surface);
2021
}
2122
dialog {

0 commit comments

Comments
 (0)