Skip to content

Commit

Permalink
Merge branch 'main' into docs/626-Spinner_Basic_Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Diaan committed Mar 21, 2024
2 parents 8f1c314 + 7e88dfd commit dabc7fd
Show file tree
Hide file tree
Showing 213 changed files with 2,440 additions and 1,069 deletions.
5 changes: 5 additions & 0 deletions .changeset/dry-starfishes-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sl-design-system/shared": patch
---

Fix missing events types
5 changes: 0 additions & 5 deletions .changeset/fair-ducks-behave.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/fair-paws-draw.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/mighty-dryers-exist.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/silver-wasps-itch.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/six-mails-learn.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/sweet-pianos-report.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/weak-jokes-beam.md

This file was deleted.

4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ node_modules/

# Dist files & folders
dist
packages/checklist/**/*.d.ts
packages/checklist/**/*.d.ts.map
packages/checklist/**/*.js
packages/checklist/**/*.js.map
packages/components/**/*.d.ts
packages/components/**/*.d.ts.map
packages/components/**/*.js
Expand Down
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { argv } from 'node:process';
const devMode = !argv.includes('build');

const config: StorybookConfig = {
stories: ['../packages/components/**/*.stories.ts'],
stories: ['../packages/{checklist,components}/**/*.stories.ts'],
addons: [
'@storybook/addon-a11y',
'@storybook/addon-actions',
Expand Down
25 changes: 23 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"workspaces": [
"chromatic",
"packages/angular",
"packages/checklist",
"packages/components/*",
"packages/locales",
"packages/themes/*",
Expand Down Expand Up @@ -40,6 +41,7 @@
"build": {
"dependencies": [
"build:cem",
"build:checklist",
"build:components",
"build:locales",
"build:themes",
Expand All @@ -59,6 +61,21 @@
"packages/components/*/custom-elements.json"
]
},
"build:checklist": {
"command": "node scripts/build-packages.js checklist",
"clean": "if-file-deleted",
"dependencies": [
"build:scss"
],
"files": [
"packages/checklist/**/*.ts",
"!packages/checklist/**/*.d.ts"
],
"output": [
"packages/checklist/**/*.js",
"packages/checklist/**/*.js.map"
]
},
"build:components": {
"command": "node scripts/build-packages.js components",
"clean": "if-file-deleted",
Expand Down Expand Up @@ -120,10 +137,10 @@
"command": "node scripts/build-scss.js",
"clean": "if-file-deleted",
"files": [
"packages/components/**/*.scss"
"packages/{checklist,components}/**/*.scss"
],
"output": [
"packages/components/**/*.scss.ts"
"packages/{checklist,components}/**/*.scss.ts"
]
},
"build:themes": {
Expand Down Expand Up @@ -205,6 +222,10 @@
"script": "build:cem",
"cascade": false
},
{
"script": "build:checklist",
"cascade": false
},
{
"script": "build:components",
"cascade": false
Expand Down
23 changes: 23 additions & 0 deletions packages/checklist/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import config from '../../eslint.config.mjs';

/**
* NOTE: All paths are relative to where eslint is run from,
* in our case the root of the monorepo.
*/
export default [
{
ignores: [
'packages/checklist/**/*.js',
'packages/checklist/**/*.d.ts',
'packages/checklist/**/*.scss.ts'
]
},
...config,
{
languageOptions: {
parserOptions: {
project: 'packages/checklist/tsconfig.json'
}
}
}
];
1 change: 1 addition & 0 deletions packages/checklist/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src/checklist.js';
43 changes: 43 additions & 0 deletions packages/checklist/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"name": "@sl-design-system/checklist",
"version": "0.0.0",
"description": "Checklist component if the SL Design System is successfully installed",
"license": "Apache-2.0",
"publishConfig": {
"registry": "https://npm.pkg.github.com"
},
"repository": {
"type": "git",
"url": "https://github.com/sl-design-system/components.git",
"directory": "packages/checklist"
},
"homepage": "https://sanomalearning.design/getting-started/developers/",
"bugs": {
"url": "https://github.com/sl-design-system/components/issues"
},
"type": "module",
"main": "./index.js",
"module": "./index.js",
"types": "./index.d.ts",
"customElements": "custom-elements.json",
"exports": {
".": "./index.js",
"./package.json": "./package.json"
},
"files": [
"**/*.d.ts",
"**/*.js",
"**/*.js.map",
"custom-elements.json"
],
"sideEffects": true,
"scripts": {
"test": "echo \"Error: run tests from monorepo root.\" && exit 1"
},
"dependencies": {
"@fortawesome/pro-solid-svg-icons": "^6.1.5",
"@open-wc/scoped-elements": "^3.0.5",
"@sl-design-system/icon": "0.0.9",
"lit": "^3.1.2"
}
}
96 changes: 96 additions & 0 deletions packages/checklist/src/checklist.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
:host {
--_background: var(--sl-color-slds-checklist-background);
--_border-radius: var(--sl-border-radius-slds-checklist);
--_border: var(--sl-border-width-slds-checklist) solid var(--sl-color-slds-checklist-border);
--_box-shadow: var(--sl-box-shadow-slds-checklist);
--_color: var(--sl-color-slds-checklist-foreground);
--_correct-color: var(--sl-color-slds-checklist-icon-success);
--_divider-color: var(--sl-color-slds-checklist-divider);
--_header-font: var(--sl-text-slds-checklist-heading);
--_incorrect-color: var(--sl-color-slds-checklist-icon-danger);
--_link-color: var(--sl-color-slds-checklist-link-idle);
--_link-hover-color: var(--sl-color-slds-checklist-link-hover);
--_link-active-color: var(--sl-color-slds-checklist-link-active);
--_padding: var(--sl-space-2xl);
--_paragraph-font: var(--sl-text-slds-checklist-body);
--_summary-font: var(--sl-text-slds-checklist-listitem);

background: var(--_background);
border: var(--_border);
border-radius: var(--_border-radius);
box-shadow: var(--_box-shadow);
color: var(--_color);
display: inline-flex;
flex-direction: column;
margin: 1rem;
max-inline-size: min(80vw, 500px);
padding: var(--_padding);
}

h1 {
font: var(--_header-font);
margin: 0;
}

p {
font: var(--_paragraph-font);
margin-block: 1rem;
}

details {
border-block-end: 1px solid var(--_divider-color);
margin-block-start: 0.75rem;
padding-block-end: 0.75rem;

&[open] {
--_icon-color: var(--_incorrect-color);
}

&:last-of-type {
margin-block-end: 1rem;
}

p {
margin-block: 0.5rem;
padding-inline-start: 2.5rem;
}
}

summary {
align-items: center;
display: flex;
font: var(--_summary-font);
gap: 1rem;

&::-webkit-details-marker {
display: none;
}
}

sl-icon {
color: var(--_icon-color, var(--_correct-color));
}

code {
font-family: ui-monospace, Menlo, Monaco, 'Cascadia Mono', 'Segoe UI Mono', 'Roboto Mono', 'Oxygen Mono',
'Ubuntu Monospace', 'Source Code Pro', 'Fira Mono', 'Droid Sans Mono', 'Courier New', monospace;
font-size: 0.9em;
font-weight: bolder;
}

a {
color: var(--_link-color);

&:visited {
color: var(--_link-color);
}

&:hover {
color: var(--_link-hover-color);
text-decoration: underline;
}

&:active {
color: var(--_link-active-color);
}
}
15 changes: 15 additions & 0 deletions packages/checklist/src/checklist.stories.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { type Meta, type StoryObj } from '@storybook/web-components';
import { html } from 'lit';
import '../index.js';

type Story = StoryObj;

export default {
title: 'Checklist',
parameters: {
layout: 'centered'
},
render: () => html`<slds-checklist></slds-checklist>`
} satisfies Meta;

export const Basic: Story = {};
Loading

0 comments on commit dabc7fd

Please sign in to comment.