@deck9/ui 0.3.3 → 0.4.0

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.
Files changed (56) hide show
  1. package/dist/index.es.js +1 -0
  2. package/dist/index.umd.js +1 -0
  3. package/dist/src/Button/Button.vue.d.ts +111 -0
  4. package/dist/{Button → src/Button}/index.d.ts +0 -0
  5. package/dist/src/Checkbox/Checkbox.vue.d.ts +42 -0
  6. package/dist/{Checkbox → src/Checkbox}/index.d.ts +0 -0
  7. package/dist/src/Icon/Icon.vue.d.ts +20 -0
  8. package/dist/{Icon → src/Icon}/index.d.ts +0 -0
  9. package/dist/{Icon → src/Icon}/registerIcons.d.ts +0 -0
  10. package/dist/src/Input/Input.vue.d.ts +90 -0
  11. package/dist/{Input → src/Input}/index.d.ts +0 -0
  12. package/dist/src/Label/Label.vue.d.ts +23 -0
  13. package/dist/{Label → src/Label}/index.d.ts +0 -0
  14. package/dist/src/env.d.ts +8 -0
  15. package/dist/{index.d.ts → src/index.d.ts} +0 -0
  16. package/{src/types.ts → dist/src/types.d.ts} +0 -0
  17. package/package.json +30 -44
  18. package/.editorconfig +0 -5
  19. package/.eslintrc.js +0 -25
  20. package/.github/workflows/release-package.yml +0 -18
  21. package/.storybook/main.ts +0 -38
  22. package/.storybook/preview.ts +0 -39
  23. package/babel.config.js +0 -3
  24. package/dist/types.d.ts +0 -5
  25. package/dist/ui.es.js +0 -21
  26. package/dist/ui.umd.js +0 -21
  27. package/postcss.config.js +0 -6
  28. package/public/favicon.ico +0 -0
  29. package/public/fonts/Inter.var.woff2 +0 -0
  30. package/public/fonts/Recursive_VF_1.078--subset-GF_latin_basic.woff2 +0 -0
  31. package/public/index.html +0 -17
  32. package/src/Button/Button.stories.ts +0 -85
  33. package/src/Button/Button.vue +0 -126
  34. package/src/Button/index.ts +0 -1
  35. package/src/Checkbox/Checkbox.stories.ts +0 -34
  36. package/src/Checkbox/Checkbox.vue +0 -48
  37. package/src/Checkbox/index.ts +0 -1
  38. package/src/Icon/Icon.stories.ts +0 -47
  39. package/src/Icon/Icon.vue +0 -33
  40. package/src/Icon/IconCollection.vue +0 -29
  41. package/src/Icon/index.ts +0 -3
  42. package/src/Icon/registerIcons.ts +0 -37
  43. package/src/Icons.stories.mdx +0 -24
  44. package/src/Input/Input.stories.ts +0 -58
  45. package/src/Input/Input.vue +0 -75
  46. package/src/Input/index.ts +0 -1
  47. package/src/Label/Label.stories.ts +0 -14
  48. package/src/Label/Label.vue +0 -16
  49. package/src/Label/index.ts +0 -1
  50. package/src/Typography.stories.mdx +0 -51
  51. package/src/index.ts +0 -5
  52. package/src/shims-vue.d.ts +0 -6
  53. package/styles/app.less +0 -16
  54. package/tailwind.config.js +0 -50
  55. package/tsconfig.json +0 -42
  56. package/vite.config.ts +0 -35
@@ -1,48 +0,0 @@
1
- <template>
2
- <div class="relative flex items-start">
3
- <div class="flex items-center h-5">
4
- <input
5
- class="h-4 w-4 border-grey-600 dark:text-blue-500 dark:border-grey-300 dark:checked:border-blue-500 dark:focus:ring-blue-900 dark:focus:ring-offset-grey-800 rounded-sm"
6
- type="checkbox"
7
- :checked="modelValue"
8
- :id="id"
9
- />
10
- </div>
11
- <div class="ml-2 text-sm leading-5">
12
- <label
13
- :for="id"
14
- class="font-medium text-grey-900 dark:text-grey-200 casual-25"
15
- >{{ label }}</label
16
- >
17
- <p
18
- v-if="description"
19
- class="text-grey-700 dark:text-grey-400 mono-0 casual-60"
20
- >
21
- {{ description }}
22
- </p>
23
- </div>
24
- </div>
25
- </template>
26
-
27
- <script setup lang="ts">
28
- import { withDefaults } from "vue";
29
- import { v4 as uuidv4 } from "uuid";
30
-
31
- interface CheckboxProps {
32
- id?: string;
33
- label: string;
34
- modelValue: boolean;
35
- description?: string;
36
- checked?: boolean;
37
- }
38
-
39
- interface CheckboxEmits {
40
- (e: "update:modelValue"): void;
41
- }
42
-
43
- const props = withDefaults(defineProps<CheckboxProps>(), {
44
- id: uuidv4(),
45
- });
46
-
47
- const emit = defineEmits<CheckboxEmits>();
48
- </script>
@@ -1 +0,0 @@
1
- export { default as D9Checkbox } from "./Checkbox.vue";
@@ -1,47 +0,0 @@
1
- import { D9Icon } from "@/index";
2
- import { icons } from "@/index";
3
-
4
- export default {
5
- title: "BotReach/Icon",
6
- component: D9Icon,
7
- argTypes: {
8
- size: {
9
- control: { type: "select", options: ["xs", "1x", "2x", "3x", "4x"] },
10
- },
11
- name: {
12
- control: { type: "select", options: icons },
13
- },
14
- },
15
- decorators: [
16
- () => ({
17
- template:
18
- '<div class="px-8 py-4 inline-block text-grey-50"><story/></div>',
19
- }),
20
- ],
21
- };
22
-
23
- const Template = (args, { argTypes }) => ({
24
- components: { D9Icon },
25
- setup() {
26
- return { args };
27
- },
28
- template: '<d9-icon v-bind="args" />',
29
- });
30
-
31
- export const Primary = Template.bind({});
32
- Primary.args = {
33
- name: "user",
34
- size: "1x",
35
- };
36
-
37
- export const Small = Template.bind({});
38
- Small.args = {
39
- name: "user",
40
- size: "xs",
41
- };
42
-
43
- export const Large = Template.bind({});
44
- Large.args = {
45
- name: "user",
46
- size: "2x",
47
- };
package/src/Icon/Icon.vue DELETED
@@ -1,33 +0,0 @@
1
- <template>
2
- <font-awesome-icon
3
- v-if="isIconAvailable"
4
- :icon="['fas', name]"
5
- v-bind="$attrs"
6
- />
7
- </template>
8
-
9
- <script setup lang="ts">
10
- import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
11
- import { withDefaults, computed } from "vue";
12
- import { icons } from "../index";
13
-
14
- interface IconProps {
15
- name: string;
16
- }
17
-
18
- const props = withDefaults(defineProps<IconProps>(), {
19
- name: "user",
20
- });
21
-
22
- const isIconAvailable = computed((): boolean => {
23
- if (icons.includes(props.name)) {
24
- return true;
25
- } else {
26
- console.warn(
27
- "could not load icon, because it is not available",
28
- props.name
29
- );
30
- return false;
31
- }
32
- });
33
- </script>
@@ -1,29 +0,0 @@
1
- <template>
2
- <div class="grid grid-cols-6 gap-4 max-w-6xl mx-auto">
3
- <div
4
- v-for="icon in icons"
5
- :key="icon"
6
- class="bg-grey-800 text-center h-16 text-blue-50 flex items-center justify-center rounded"
7
- >
8
- <div>
9
- <icon v-bind="{ name: icon, size: '1x' }" />
10
- <span class="block text-xs text-grey-400 mono-100 mt-2">{{
11
- icon
12
- }}</span>
13
- </div>
14
- </div>
15
- </div>
16
- </template>
17
-
18
- <script>
19
- import Icon from "./Icon.vue";
20
-
21
- export default {
22
- name: "icon-collection",
23
-
24
- components: { Icon },
25
- props: {
26
- icons: { type: Array, required: true },
27
- },
28
- };
29
- </script>
package/src/Icon/index.ts DELETED
@@ -1,3 +0,0 @@
1
- export { default as icons } from "./registerIcons";
2
-
3
- export { default as D9Icon } from "./Icon.vue";
@@ -1,37 +0,0 @@
1
- import { library } from "@fortawesome/fontawesome-svg-core";
2
- import * as fasIcons from "@fortawesome/free-solid-svg-icons";
3
-
4
- library.add(
5
- fasIcons.faChartPie,
6
- fasIcons.faCheck,
7
- fasIcons.faCheckCircle,
8
- fasIcons.faChevronDown,
9
- fasIcons.faChevronLeft,
10
- fasIcons.faChevronRight,
11
- fasIcons.faChevronUp,
12
- fasIcons.faCircleNotch,
13
- fasIcons.faClipboard,
14
- fasIcons.faCog,
15
- fasIcons.faDoorOpen,
16
- fasIcons.faEllipsisH,
17
- fasIcons.faEnvelope,
18
- fasIcons.faExclamationTriangle,
19
- fasIcons.faFingerprint,
20
- fasIcons.faGlobe,
21
- fasIcons.faHandPointRight,
22
- fasIcons.faInfoCircle,
23
- fasIcons.faPencilAlt,
24
- fasIcons.faPlayCircle,
25
- fasIcons.faPlus,
26
- fasIcons.faPlusCircle,
27
- fasIcons.faRobot,
28
- fasIcons.faSave,
29
- fasIcons.faShieldAlt,
30
- fasIcons.faTimes,
31
- fasIcons.faTrash,
32
- fasIcons.faUser,
33
- fasIcons.faUserShield
34
- );
35
-
36
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
- export default [...Object.keys((library as any).definitions.fas)].sort();
@@ -1,24 +0,0 @@
1
- <!--- Icons.stories.mdx -->
2
-
3
- import { Meta, Story, Canvas } from '@storybook/addon-docs';
4
- import IconCollection from "./Icon/IconCollection.vue";
5
- import { icons } from "@/index";
6
-
7
- <Meta title="Reference/Icons Overview" />
8
-
9
- # Icons used in BotReach UI
10
-
11
- This page gives an overview of all icons used in BotReach UI.
12
-
13
- export const Primary = (args) => ({
14
- components: {IconCollection},
15
- setup() {
16
- return {args, icons: icons};
17
- },
18
- template: '<icon-collection v-bind="{icons}" />',
19
- });
20
-
21
- <Story name="All">
22
- {Primary.bind({})}
23
- </Story>
24
-
@@ -1,58 +0,0 @@
1
- import { D9Input } from "@/index";
2
- import { icons } from "@/index";
3
- import { v4 as uuidv4 } from "uuid";
4
- import { ref } from "vue";
5
-
6
- export default {
7
- title: "Forms/Input",
8
- component: D9Input,
9
- argTypes: {
10
- type: { control: { type: "inline-radio" }, options: ["text", "password"] },
11
- size: {
12
- control: { type: "inline-radio" },
13
- options: ["small", "medium", "large"],
14
- },
15
- icon: { control: { type: "select" }, options: icons },
16
- },
17
- };
18
-
19
- const Template = (args) => ({
20
- setup() {
21
- return {
22
- args,
23
- uid: ref(uuidv4()),
24
- };
25
- },
26
- components: { D9Input },
27
- template: `<div><d9-input v-bind="args" /></div>`,
28
- });
29
-
30
- export const Default = Template.bind({});
31
- Default.args = {
32
- placeholder: "Your Input",
33
- };
34
-
35
- export const Small = Template.bind({});
36
- Small.args = {
37
- placeholder: "Your Input",
38
- size: "small",
39
- };
40
-
41
- export const Large = Template.bind({});
42
- Large.args = {
43
- placeholder: "Your Input",
44
- size: "large",
45
- };
46
-
47
- export const Disabled = Template.bind({});
48
- Disabled.args = {
49
- placeholder: "Your Input",
50
- isDisabled: true,
51
- };
52
-
53
- export const WithIcon = Template.bind({});
54
- WithIcon.args = {
55
- placeholder: "Your Input",
56
- size: "medium",
57
- icon: "user",
58
- };
@@ -1,75 +0,0 @@
1
- <template>
2
- <div class="relative">
3
- <input
4
- class="mono-50 bg-grey-50 text-grey-800 placeholder-grey-600 border-grey-300 dark:bg-grey-800 dark:text-grey-100 dark:placeholder-grey-400 dark:border-grey-700 focus:border-blue-400 focus:ring-blue-400 dark:focus:border-blue-800 dark:focus:ring-blue-800"
5
- :placeholder="placeholder"
6
- :class="{ ...inputClasses, ...textSizeClasses, ...disabledClasses }"
7
- :type="type"
8
- @input="input($event)"
9
- :tabindex="isDisabled ? '-1' : undefined"
10
- />
11
-
12
- <span
13
- v-if="icon"
14
- class="absolute left-0 inset-y-0 inline-flex items-center justify-center text-grey-700 dark:text-grey-100 px-4"
15
- :class="textSizeClasses"
16
- >
17
- <D9Icon :name="icon" />
18
- </span>
19
- </div>
20
- </template>
21
-
22
- <script setup lang="ts">
23
- import { D9Icon } from "../index";
24
- import { Size } from "../types";
25
- import { computed, withDefaults } from "vue";
26
-
27
- interface InputProps {
28
- type: string;
29
- placeholder?: string;
30
- size?: Size;
31
- icon?: string;
32
- isDisabled?: boolean;
33
- }
34
-
35
- interface InputEmits {
36
- (e: "onInput", value: Event): void;
37
- }
38
-
39
- const props = withDefaults(defineProps<InputProps>(), {
40
- type: "text",
41
- size: "medium",
42
- isDisabled: false,
43
- });
44
-
45
- const emit = defineEmits<InputEmits>();
46
-
47
- const inputClasses = computed(() => {
48
- return {
49
- "px-3 py-1 rounded font-normal": props.size === "small",
50
- "px-4 py-3 rounded font-normal": props.size === "medium",
51
- "px-6 py-3 rounded font-normal": props.size === "large",
52
-
53
- "pl-10": props.icon && props.size === "small",
54
- "pl-12": props.icon && (props.size === "medium" || props.size === "large"),
55
- };
56
- });
57
-
58
- const disabledClasses = computed(() => {
59
- return {
60
- "pointer-events-none opacity-50 cursor-not-allowed": props.isDisabled,
61
- };
62
- });
63
-
64
- const textSizeClasses = computed(() => {
65
- return {
66
- "text-xs leading-4": props.size === "small",
67
- "text-sm leading-4": props.size === "medium",
68
- "text-base leading-4": props.size === "large",
69
- };
70
- });
71
-
72
- const input = function (payload: Event): void {
73
- emit("onInput", payload);
74
- };
75
- </script>
@@ -1 +0,0 @@
1
- export { default as D9Input } from "./Input.vue";
@@ -1,14 +0,0 @@
1
- import D9Label from "./Label.vue";
2
-
3
- export default {
4
- title: "Forms/Label",
5
- component: D9Label,
6
- };
7
-
8
- export const Default = (args) => ({
9
- components: {D9Label},
10
- setup() {
11
- return {args};
12
- },
13
- template: '<d9-label id="name" label="Your name" />',
14
- });
@@ -1,16 +0,0 @@
1
- <template>
2
- <span class="inline-block text-blue-900 text-sm font-medium">
3
- <label :for="id">{{ label }}</label>
4
- <span v-if="description">{{ description }}</span>
5
- </span>
6
- </template>
7
-
8
- <script>
9
- export default {
10
- props: {
11
- id: { type: String, required: true },
12
- label: { type: String, required: true },
13
- description: { type: String, default: undefined },
14
- },
15
- };
16
- </script>
@@ -1 +0,0 @@
1
- export { default as D9Label } from "./Label.vue";
@@ -1,51 +0,0 @@
1
- <!--- Icons.stories.mdx -->
2
-
3
- import { Meta, Story, Canvas } from '@storybook/addon-docs';
4
- import { icons } from "./index";
5
-
6
- <Meta title="Reference/Typography" />
7
-
8
- # Icons used in BotReach UI
9
-
10
- This page gives an overview of all icons used in BotReach UI.
11
-
12
- export const Primary = (args) => ({
13
- template: `
14
- <div class="text-grey-800 dark:text-white space-y-8">
15
- <div>
16
- <h1 class="text-2xl font-bold casual-0 mono-100">
17
- Same font, but different
18
- </h1>
19
- <span class="font-mono bg-grey-100 dark:bg-grey-800 inline-block py-1 px-2 text-xs">mono-100 casual-0
20
- <span class="hidden text-red-500">hover:mono-0</span></span>
21
- </div>
22
- <div>
23
- <h1 class="text-2xl font-bold casual-100 mono-100">
24
- Same font, more casual
25
- </h1>
26
- <span class="font-mono bg-grey-100 dark:bg-grey-800 inline-block py-1 px-2 text-xs">mono-100 casual-100</span>
27
- </div>
28
- <div>
29
- <h1 class="text-2xl font-bold casual-100 mono-0">
30
- No mono, but casual
31
- </h1>
32
- <span class="font-mono bg-grey-100 dark:bg-grey-800 inline-block py-1 px-2 text-xs">mono-0 casual-100</span>
33
- </div>
34
- <div>
35
- <h1 class="text-2xl font-bold casual-100 mono-0">
36
- <span class="italic-mild">Italic, but mild</span><br />
37
- <span class="italic">Italic, the default</span><br />
38
- <span class="italic-intense">Italic, but intense</span>
39
- </h1>
40
- <span class="font-mono bg-grey-100 dark:bg-grey-800 inline-block py-1 px-2 text-xs">a) italic-mild; b) italic; c)
41
- italic-intense</span>
42
- </div>
43
- </div>
44
- `,
45
- });
46
-
47
-
48
- <Story name="All">
49
- {Primary.bind({})}
50
- </Story>
51
-
package/src/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from "./Button/index";
2
- export * from "./Checkbox/index";
3
- export * from "./Icon/index";
4
- export * from "./Input/index";
5
- export * from "./Label/index";
@@ -1,6 +0,0 @@
1
- /* eslint-disable */
2
- declare module '*.vue' {
3
- import type { DefineComponent } from 'vue'
4
- const component: DefineComponent<{}, {}, any>
5
- export default component
6
- }
package/styles/app.less DELETED
@@ -1,16 +0,0 @@
1
- @font-face {
2
- font-family: 'Recursive var';
3
- font-weight: 300 1000;
4
- font-style: oblique 0deg 15deg;
5
- font-display: swap;
6
- src: url("../public/fonts/Recursive_VF_1.078--subset-GF_latin_basic.woff2") format("woff2");
7
- }
8
-
9
- body {
10
- font-feature-settings: "dlig"1, "liga"1;
11
- @apply font-sans;
12
- }
13
-
14
- @tailwind base;
15
- @tailwind components;
16
- @tailwind utilities;
@@ -1,50 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- const defaultTheme = require("tailwindcss/defaultTheme");
3
- const colors = require("tailwindcss/colors");
4
-
5
- module.exports = {
6
- mode: "jit",
7
- purge: {
8
- content: ["./src/**/*.vue", "./src/**/*.mdx"],
9
- whitelistPatterns: [/svg.*/, /fa.*/],
10
- },
11
- darkMode: "class",
12
- theme: {
13
- extend: {
14
- colors: {
15
- black: "#050505",
16
- white: "#ffffff",
17
- grey: colors.blueGray,
18
- red: colors.red,
19
- yellow: colors.yellow,
20
- blue: colors.blue,
21
- },
22
- container: {
23
- center: true,
24
- padding: "1rem",
25
- },
26
- fontFamily: {
27
- sans: ["Recursive var", ...defaultTheme.fontFamily.sans],
28
- },
29
- opacity: {
30
- 10: "0.1",
31
- 20: "0.2",
32
- 30: "0.3",
33
- 40: "0.4",
34
- 50: "0.5",
35
- 60: "0.6",
36
- 70: "0.7",
37
- 80: "0.8",
38
- 90: "0.9",
39
- },
40
- },
41
- },
42
- variants: {
43
- extend: {},
44
- },
45
- plugins: [
46
- require("@tailwindcss/forms"),
47
- require("@tailwindcss/typography"),
48
- require("@deck9/tailwindcss-recursive-font-helper"),
49
- ],
50
- };
package/tsconfig.json DELETED
@@ -1,42 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es5",
4
- "module": "es2015",
5
- "strict": true,
6
- "jsx": "preserve",
7
- "importHelpers": true,
8
- "moduleResolution": "node",
9
- "experimentalDecorators": true,
10
- "skipLibCheck": true,
11
- "esModuleInterop": true,
12
- "allowSyntheticDefaultImports": true,
13
- "sourceMap": true,
14
- "outDir": "dist",
15
- "declaration": true,
16
- "declarationDir": ".",
17
- "baseUrl": ".",
18
- "paths": {
19
- "@/*": [
20
- "src/*"
21
- ]
22
- },
23
- "types": [
24
- "webpack-env"
25
- ],
26
- "lib": [
27
- "esnext",
28
- "dom",
29
- "dom.iterable",
30
- "scripthost"
31
- ]
32
- },
33
- "include": [
34
- "src/**/*.ts",
35
- "src/**/*.vue",
36
- ],
37
- "exclude": [
38
- "node_modules",
39
- "./tailwind.config.js",
40
- "./**/*.stories.ts"
41
- ]
42
- }
package/vite.config.ts DELETED
@@ -1,35 +0,0 @@
1
- import path from "path";
2
- import { defineConfig } from "vite";
3
- import vue from "@vitejs/plugin-vue";
4
- import typescript from "@rollup/plugin-typescript";
5
-
6
- // https://vitejs.dev/config/
7
- export default defineConfig({
8
- plugins: [vue()],
9
- publicDir: false,
10
- build: {
11
- lib: {
12
- entry: path.resolve(__dirname, "src/index.ts"),
13
- name: "ui",
14
- fileName: (format) => `ui.${format}.js`,
15
- },
16
- rollupOptions: {
17
- external: ["vue"],
18
- output: {
19
- globals: {
20
- vue: "Vue",
21
- },
22
- },
23
- plugins: [
24
- typescript({
25
- target: "es5",
26
- rootDir: path.resolve(__dirname, "./src"),
27
- declaration: true,
28
- declarationDir: path.resolve(__dirname, "./dist"),
29
- exclude: path.resolve(__dirname, "./node_modules/**"),
30
- allowSyntheticDefaultImports: true,
31
- }),
32
- ],
33
- },
34
- },
35
- });