Skip to content

Commit 114326e

Browse files
committed
Merge branch 'v1/contrib' into pr/915
2 parents 2442a2f + 8e7b851 commit 114326e

File tree

133 files changed

+17211
-29779
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+17211
-29779
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ out-css
3838

3939
# old source
4040
/src
41+
42+
*storybook.log

.storybook/main.js

Lines changed: 0 additions & 72 deletions
This file was deleted.

.storybook/main.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { StorybookConfig } from '@storybook/web-components-vite';
2+
import { html } from 'lit';
3+
import { join, dirname } from 'path';
4+
5+
/**
6+
* This function is used to resolve the absolute path of a package.
7+
* It is needed in projects that use Yarn PnP or are set up within a monorepo.
8+
*/
9+
function getAbsolutePath(value: string): any {
10+
return dirname(require.resolve(join(value, 'package.json')));
11+
}
12+
13+
const config: StorybookConfig = {
14+
stories: [
15+
'../packages/**/*.mdx',
16+
'../packages/**/*.story.@(js|jsx|mjs|ts|tsx)',
17+
'../stories/**/*.story.@(js|jsx|mjs|ts|tsx)',
18+
],
19+
staticDirs: ['./images'],
20+
addons: [
21+
getAbsolutePath('@storybook/addon-links'),
22+
getAbsolutePath('@storybook/addon-essentials'),
23+
getAbsolutePath('@chromatic-com/storybook'),
24+
getAbsolutePath('@storybook/addon-a11y'),
25+
'../storyhelpers/storybook-readme',
26+
],
27+
framework: {
28+
name: getAbsolutePath('@storybook/web-components-vite'),
29+
options: {},
30+
},
31+
};
32+
export default config;

.storybook/manager.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from '@storybook/addons';
1+
import { addons } from '@storybook/manager-api';
22
import umbracoTheme from './umbraco-theme';
33

44
addons.setConfig({

.storybook/preview-body.html

Lines changed: 0 additions & 4 deletions
This file was deleted.

.storybook/preview-head.html

Lines changed: 0 additions & 51 deletions
This file was deleted.
Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,41 @@
1+
import {
2+
setCustomElementsManifest,
3+
type Preview,
4+
} from '@storybook/web-components';
15
import '../packages/uui-css/lib/uui-css.css';
2-
import 'element-internals-polyfill';
3-
4-
import { setCustomElements } from '@storybook/web-components';
5-
66
import customElements from '../custom-elements.json';
7+
import { html } from 'lit';
78

8-
export const parameters = {
9-
layout: 'padded',
10-
actions: { argTypesRegex: '^on[A-Z].*' },
11-
controls: {
12-
matchers: {
13-
color: /(background|color)/i,
14-
date: /Date$/,
9+
import '@umbraco-ui/uui-icon-registry-essential/lib';
10+
11+
const preview: Preview = {
12+
parameters: {
13+
controls: {
14+
matchers: {
15+
color: /(background|color)$/i,
16+
date: /Date$/i,
17+
},
1518
},
16-
},
17-
docs: {
18-
source: { state: 'open' },
19-
},
20-
options: {
21-
method: 'alphabetical',
22-
storySort: (a, b) => {
23-
//NOTE: This has to be an inline function for some reason
24-
if (a.title === 'Overview') {
25-
return 0;
26-
}
27-
if (b.title === 'Overview') {
28-
return 1;
29-
}
30-
return a.title > b.title;
19+
docs: {
20+
source: {
21+
excludeDecorators: true,
22+
format: 'html', // see storybook docs for more info on this format https://storybook.js.org/docs/api/doc-blocks/doc-block-source#format
23+
},
3124
},
3225
},
26+
tags: ['autodocs'],
27+
28+
decorators: [
29+
story => {
30+
return html`<uui-icon-registry-essential class="uui-font uui-text"
31+
>${story()}</uui-icon-registry-essential
32+
>`;
33+
},
34+
],
3335
};
3436

3537
WebComponentFormatter(customElements);
36-
37-
setCustomElements(customElements);
38+
setCustomElementsManifest(customElements);
3839

3940
function WebComponentFormatter(customElements) {
4041
for (let tag of customElements.tags || []) {
@@ -59,19 +60,19 @@ function WebComponentFormatter(customElements) {
5960
}
6061
}
6162

62-
// Find all names of properties
63-
const propertyNames = (tag.properties || []).map(p => p.name);
63+
// add 'Event' to the name of all events
64+
for (let event of tag.events || []) {
65+
event.name = `${event.name} event`;
66+
}
6467

6568
// Run through all slots to clean them up a bit
6669
for (let slot of tag.slots || []) {
6770
// Replace the name of the default slot so Storybook will show it
6871
if (typeof slot.name === 'string' && slot.name.length === 0) {
6972
slot.name = 'slot';
70-
}
71-
72-
// If the slot has the same name as a property, then add the word 'slot' to the name
73-
// Bug reported to Storybook here: https://github.com/storybookjs/storybook/issues/17733
74-
if (propertyNames.includes(slot.name)) {
73+
} else {
74+
// Add slot to the name. This will allow us to filter out slots in various situations. Example the spread directive.
75+
// Bug reported to Storybook here: https://github.com/storybookjs/storybook/issues/17733
7576
slot.name = `${slot.name} slot`;
7677
}
7778

@@ -84,3 +85,5 @@ function WebComponentFormatter(customElements) {
8485

8586
return customElements;
8687
}
88+
89+
export default preview;

.storybook/umbraco-theme.js

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

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
All notable changes to this project will be documented in this file.
44
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
55

6+
## [1.10.1](https://github.com/umbraco/Umbraco.UI/compare/v1.10.0...v1.10.1) (2024-10-09)
7+
8+
### Bug Fixes
9+
10+
- **uui-slider:** Focus handle in slider instead of slider track itself ([#918](https://github.com/umbraco/Umbraco.UI/issues/918)) ([b3438a0](https://github.com/umbraco/Umbraco.UI/commit/b3438a07d28e945a1f98ebfd976d4f661222ed51))
11+
612
# [1.10.0](https://github.com/umbraco/Umbraco.UI/compare/v1.10.0-rc.0...v1.10.0) (2024-09-16)
713

814
**Note:** Version bump only for package uui-monorepo

eslint.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ export default [
2626
// Global ignores
2727
includeIgnoreFile(gitignorePath),
2828
{
29-
ignores: ['**/*.{cjs,mjs,js}', 'vite.config.ts', 'stories/'],
29+
ignores: [
30+
'**/*.{cjs,mjs,js}',
31+
'vite.config.ts',
32+
'stories/',
33+
'**/.storybook/**',
34+
],
3035
},
3136

3237
// Global config

0 commit comments

Comments
 (0)