From 772fcb1dfb3b18e7a507cadccd3c865f5cdc0fd1 Mon Sep 17 00:00:00 2001 From: Laurens Groeneveld Date: Mon, 6 Mar 2023 17:07:28 +0100 Subject: [PATCH] Add capacity indicator component (#19) + Don't automatically open browser for Storybook + Update icons package --- docs/contributing/README.md | 5 +- package-lock.json | 16 ++-- package.json | 6 +- scripts/templates/create-vue-file.sh | 2 +- .../CapacityIndicator.spec.ts | 17 +++++ .../CapacityIndicator.stories.ts | 41 ++++++++++ .../CapacityIndicator/CapacityIndicator.vue | 74 +++++++++++++++++++ src/index.ts | 1 + 8 files changed, 149 insertions(+), 13 deletions(-) create mode 100644 src/components/CapacityIndicator/CapacityIndicator.spec.ts create mode 100644 src/components/CapacityIndicator/CapacityIndicator.stories.ts create mode 100644 src/components/CapacityIndicator/CapacityIndicator.vue diff --git a/docs/contributing/README.md b/docs/contributing/README.md index e30fcccc..294e5e0a 100644 --- a/docs/contributing/README.md +++ b/docs/contributing/README.md @@ -23,6 +23,9 @@ Figma designs are generally based on [Flowbite](https://flowbite.com/docs/gettin ### Follow Figma naming for props Props should be (if possible) be named like they are named in Figma. Usually designers will create a component in Figma that has properties as well. By keeping these as close as possible it's easier to compare different variants between design and code. +### Don't abbreviate props +Props should have a clear name that indicates what it is for, without the need to look up documentation. Abbreviations make this harder, especially for non-native speakers. Instead of trying to save on keystrokes (and modern editors will probably autocomplete props anyways), we'll save on potential user frustration. + ### Don't include all attributes as props When building a wrapper around a native HTML element such as `input`, don't include all the attributes of this element as props on the component. Vue will automatically [pass them through](https://vuejs.org/guide/components/attrs.html). If the element is not the top level element in your component (for example because it is wrapped in a `span`), bind the Vue `$attrs` property to the appropriate element. @@ -47,4 +50,4 @@ From the [Vue documentation](https://vuejs.org/guide/components/attrs.html#disab ### Don't use `