@propelinc/citrus-ui 0.2.1 → 0.2.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@propelinc/citrus-ui",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/propelinc/citrus-ui"
@@ -12,7 +12,7 @@
12
12
  "lint": "npm run lint:js && npm run lint:css",
13
13
  "lint:css": "stylelint \"src/**/*.(vue|less)\"",
14
14
  "lint:js": "vue-cli-service lint",
15
- "publish": "npm run build:dist && npm publish",
15
+ "publish:dist": "npm run build:dist && npm publish",
16
16
  "storybook:build": "vue-cli-service storybook:build -c .storybook",
17
17
  "storybook:serve": "vue-cli-service storybook:serve -p 6006 -c .storybook",
18
18
  "storybook:publish": "storybook-to-aws-s3 --script=\"storybook:build\" --bucket-path=citrus-ui-storybook",
@@ -23,6 +23,7 @@
23
23
  "dependencies": {
24
24
  "@fortawesome/fontawesome-svg-core": "^1.2.35",
25
25
  "@fortawesome/pro-light-svg-icons": "5.15.3",
26
+ "@fortawesome/pro-solid-svg-icons": "5.15.3",
26
27
  "@fortawesome/vue-fontawesome": "^2.0.2",
27
28
  "core-js": "^3.6.5",
28
29
  "vue": "^2.6.10",
@@ -0,0 +1,38 @@
1
+ <template>
2
+ <v-checkbox
3
+ v-bind="$attrs"
4
+ :value="value"
5
+ data-test="checkbox"
6
+ on-icon="$citrusCheckboxOn"
7
+ off-icon="$citrusCheckboxOff"
8
+ :ripple="false"
9
+ :rules="rules"
10
+ :hide-details="rules.length === 0"
11
+ @change="(value) => $emit('change', value)"
12
+ >
13
+ <template #label>
14
+ <slot name="label" />
15
+ </template>
16
+ </v-checkbox>
17
+ </template>
18
+
19
+ <script lang="ts">
20
+ import { Component, Vue, Prop } from 'vue-property-decorator';
21
+
22
+ @Component({ name: 'CCheckbox' })
23
+ export default class CCheckbox extends Vue {
24
+ @Prop({ type: Boolean, default: false }) value!: boolean;
25
+ @Prop({ type: Array, default: () => [] }) rules!: ((value: string) => string | boolean)[];
26
+ }
27
+ </script>
28
+
29
+ <style lang="less" scoped>
30
+ @import '~@/styles/variables.less';
31
+
32
+ /deep/ label.v-label {
33
+ .body();
34
+
35
+ color: @color-navy;
36
+ margin-bottom: 0;
37
+ }
38
+ </style>
@@ -14,17 +14,22 @@
14
14
  :rules="rules"
15
15
  :items="items"
16
16
  validate-on-blur
17
- hide-details="auto"
17
+ :hide-details="rules.length === 0"
18
18
  @input="(value) => $emit('input', value)"
19
19
  >
20
20
  <template #append>
21
21
  <font-awesome-icon
22
22
  v-if="loading"
23
23
  data-test="select-field-icon-loading"
24
+ class="fa-spin select__field__icon"
24
25
  :icon="faSpinner"
25
- class="fa-spin"
26
26
  />
27
- <font-awesome-icon v-else data-test="select-field-icon" :icon="faChevronDown" />
27
+ <font-awesome-icon
28
+ v-else
29
+ data-test="select-field-icon"
30
+ class="select__field__icon"
31
+ :icon="faChevronDown"
32
+ />
28
33
  </template>
29
34
  </select-input>
30
35
  </form-field>
@@ -64,4 +69,8 @@ export default class CSelect extends Vue {
64
69
  .select__field--disabled {
65
70
  .form-field-disabled();
66
71
  }
72
+
73
+ .select__field__icon {
74
+ z-index: 1;
75
+ }
67
76
  </style>
@@ -14,7 +14,7 @@
14
14
  :value="value"
15
15
  :rules="rules"
16
16
  validate-on-blur
17
- hide-details="auto"
17
+ :hide-details="rules.length === 0"
18
18
  @input="(value) => $emit('input', value)"
19
19
  >
20
20
  <template #append>
package/src/index.d.ts CHANGED
@@ -2,11 +2,13 @@ import { Component } from 'vue';
2
2
 
3
3
  import _Colors from './colors/colors.json';
4
4
  import _Theme from './colors/theme';
5
+ import _Icons from './theme/icons';
5
6
 
6
7
  export const CAlert: Component;
7
8
  export const CBanner: Component;
8
9
  export const CButton: Component;
9
10
  export const CCard: Component;
11
+ export const CCheckbox: Component;
10
12
  export const CIconButton: Component;
11
13
  export const CListItem: Component;
12
14
  export const CModalLoading: Component;
@@ -19,3 +21,4 @@ export const CTextField: Component;
19
21
 
20
22
  export const Theme: typeof _Theme;
21
23
  export const Colors: typeof _Colors;
24
+ export const Icons: typeof _Icons;
package/src/index.ts CHANGED
@@ -4,6 +4,7 @@ import _CAlert from '@/components/CAlert.vue';
4
4
  import _CBanner from '@/components/CBanner.vue';
5
5
  import _CButton from '@/components/CButton.vue';
6
6
  import _CCard from '@/components/CCard.vue';
7
+ import _CCheckbox from '@/components/CCheckbox.vue';
7
8
  import _CIconButton from '@/components/CIconButton.vue';
8
9
  import _CListItem from '@/components/CListItem.vue';
9
10
  import _CModalLoading from '@/components/CModalLoading.vue';
@@ -13,16 +14,19 @@ import _CSelect from '@/components/CSelect.vue';
13
14
  import _CSkeletonLoaderCircle from '@/components/CSkeletonLoaderCircle.vue';
14
15
  import _CSkeletonLoaderText from '@/components/CSkeletonLoaderText.vue';
15
16
  import _CTextField from '@/components/CTextField.vue';
17
+ import _Icons from '@/theme/icons';
16
18
 
17
19
  import '@/styles/core.less';
18
20
 
19
21
  export const Colors = _Colors;
20
22
  export const Theme = _Theme;
23
+ export const Icons = _Icons;
21
24
 
22
25
  export const CAlert = _CAlert;
23
26
  export const CBanner = _CBanner;
24
27
  export const CButton = _CButton;
25
28
  export const CCard = _CCard;
29
+ export const CCheckbox = _CCheckbox;
26
30
  export const CIconButton = _CIconButton;
27
31
  export const CListItem = _CListItem;
28
32
  export const CModalLoading = _CModalLoading;
@@ -30,7 +30,6 @@
30
30
  border-color: @color-neutral-shade;
31
31
  border-radius: @border-radius;
32
32
  top: 0;
33
- z-index: -1;
34
33
  }
35
34
  }
36
35
 
@@ -0,0 +1,17 @@
1
+ import { faCircle } from '@fortawesome/pro-light-svg-icons';
2
+ import { faCheckCircle } from '@fortawesome/pro-solid-svg-icons';
3
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
4
+ import { VuetifyIcons } from 'vuetify/types/services/icons';
5
+
6
+ const Icons = {
7
+ citrusCheckboxOn: {
8
+ component: FontAwesomeIcon,
9
+ props: { icon: faCheckCircle },
10
+ },
11
+ citrusCheckboxOff: {
12
+ component: FontAwesomeIcon,
13
+ props: { icon: faCircle },
14
+ },
15
+ } as Partial<VuetifyIcons>;
16
+
17
+ export default Icons;