Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve typings and export interfaces #148

Merged
merged 21 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@rei/cedar",
"version": "14.0.1",
"version": "14.0.2",
"description": "REI Cedar Component Library",
"homepage": "https://rei.github.io/rei-cedar/",
"license": "MIT",
Expand Down Expand Up @@ -67,7 +67,7 @@
"autoprefixer": "^10.2.5",
"c8": "^7.11.0",
"chalk": "^4.1.0",
"chromedriver": "^115.0.0",
"chromedriver": "^116.0.0",
"concat": "^1.0.3",
"cross-env": "^7.0.3",
"cz-conventional-changelog": "^3.3.0",
Expand Down
2 changes: 1 addition & 1 deletion rollupOptions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default {
exclude: ['node_modules/**'],
babelHelpers: 'bundled',
babelrc: false,
extensions: ['.js', '.mjs', '.vue'],
extensions: ['.js', '.ts', '.mjs', '.vue'],
targets: browserTargets,
presets: [
[
Expand Down
2 changes: 1 addition & 1 deletion src/components/accordion/CdrAccordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import IconCaretDown from '../icon/comps/caret-down.vue';
import { modifyClassName } from '../../utils/buildClass';
import mapClasses from '../../utils/mapClasses';
import { unwrappedKey } from './symbols';
import { unwrappedKey } from '../../types/symbols';

/** Vertically-stacked list that allows users to expand and collapse additional content */

Expand Down
2 changes: 1 addition & 1 deletion src/components/accordion/CdrAccordionGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
import { debounce } from '../../utils/debounce';
import propValidator from '../../utils/propValidator';
import getCurrentBreakpoint from '../../mixins/breakpoints';
import { unwrappedKey } from './symbols';
import { unwrappedKey } from '../../types/symbols';

defineOptions({
name: 'CdrAccordionGroup',
Expand Down
2 changes: 1 addition & 1 deletion src/components/accordion/__tests__/CdrAccordion.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { shallowMount, mount } from '../../../../test/vue-jest-style-workaround.js';
import CdrAccordion from '../CdrAccordion.vue';
import { unwrappedKey } from '../symbols';
import { unwrappedKey } from '../../../types/symbols';

const baseComponentPattern = {
propsData: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/accordion/styles/CdrAccordion.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
//@import url('@rei/cedar/dist/style/cdr-icon.css');
@import '../../icon/styles/CdrIcon.module.scss';
//@import url('@rei/cedar/dist/style/cdr-accordion-group.css');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';

.cdr-accordion-group {
display: block;
Expand Down
6 changes: 0 additions & 6 deletions src/components/accordion/symbols.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/banner/styles/CdrBanner.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrBanner.vars.scss';

.cdr-banner {
Expand Down
19 changes: 2 additions & 17 deletions src/components/breadcrumb/CdrBreadcrumb.vue
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
<script setup lang="ts">
import {
useCssModule, computed, ref, watch, nextTick,
useCssModule, computed, ref, watch, nextTick, type PropType
} from 'vue';
import type { PropType } from 'vue';
import { breadcrumbItem } from '../../types/interfaces';
import uid from '../../utils/uid';

/** Navigation used to reveal a page's location within the site hierarchy */
defineOptions({
name: 'CdrBreadcrumb',
});

/**
* Breadcrumb data object
*
* @interface breadcrumbItem
* @url {string} The url for the breadcrumb link
* @name {string} The display name for breadcrumb link
* @id {string} Optional id
*/
interface breadcrumbItem {
item: {
url: string,
name: string,
id?: string,
}
}
const props = defineProps({
/**
* Sets the array of a breadcrumb object containing a 'url' and 'name' property.
Expand Down
2 changes: 1 addition & 1 deletion src/components/breadcrumb/styles/CdrBreadcrumb.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrBreadcrumb.vars.scss';

.cdr-breadcrumb {
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/styles/CdrButton.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrButton.vars.scss';
.cdr-button {
@include cdr-button-base-mixin;
Expand Down
2 changes: 1 addition & 1 deletion src/components/caption/styles/CdrCaption.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

:Base - CdrCaption
========================================================================== */
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrCaption.vars.scss';
.cdr-caption {
@include cdr-caption-container-mixin;
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/styles/CdrCard.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrCard.vars.scss';
.cdr-card {
@include cdr-card-base-mixin;
Expand Down
2 changes: 1 addition & 1 deletion src/components/checkbox/styles/CdrCheckbox.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrCheckbox.vars.scss';
//@import url('@rei/cedar/dist/style/cdr-label-wrapper.css');
@import '../../labelWrapper/styles/CdrLabelWrapper.module.scss';
Expand Down
2 changes: 1 addition & 1 deletion src/components/chip/styles/CdrChip.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrChip.vars.scss';

.cdr-chip {
Expand Down
2 changes: 1 addition & 1 deletion src/components/chip/styles/CdrChipGroup.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrChipGroup.vars.scss';

.cdr-chip-group {
Expand Down
2 changes: 1 addition & 1 deletion src/components/container/styles/CdrContainer.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';

.cdr-container {
@include cdr-text-default;
Expand Down
2 changes: 1 addition & 1 deletion src/components/formError/styles/CdrFormError.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrFormError.vars.scss';

.cdr-form-error {
Expand Down
2 changes: 1 addition & 1 deletion src/components/formGroup/styles/CdrFormGroup.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrFormGroup.vars.scss';
//@import '~@rei/cedar/dist/style/cdr-form-error.css';
@import '../../formError/styles/CdrFormError.module.scss';
Expand Down
2 changes: 1 addition & 1 deletion src/components/grid/styles/CdrGrid.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrGrid.vars.scss';

.cdr-grid {
Expand Down
2 changes: 1 addition & 1 deletion src/components/icon/styles/CdrIcon.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';

.cdr-icon {
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion src/components/image/styles/CdrImg.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';

.cdr-image {
max-width: 100%;
Expand Down
14 changes: 7 additions & 7 deletions src/components/input/styles/CdrInput.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrInput.vars.scss';
@import '../../labelStandalone/styles/CdrLabelStandalone.module.scss';
@import '../../formError/styles/CdrFormError.module.scss';
Expand All @@ -14,7 +14,7 @@
margin-left: -4px;
&::before {
content: '';
//ITEM_DOC: Background color of the cdr-button label
//ITEM_DOC: Background color of the cdr-button label
background-color: var(--cdr-input-label-background-color, var(--cdr-color-border-input-default, #{$cdr-color-border-input-default}));
position: absolute;
left: -1px;
Expand All @@ -29,12 +29,12 @@
&:active,
&:focus,
&:focus-within {
//ITEM_DOC: Background color of the cdr-input label in hover, active, focus, and focus-within states
//ITEM_DOC: Background color of the cdr-input label in hover, active, focus, and focus-within states
background-color: var(--cdr-input-label-background-interaction, var(--cdr-color-background-input-default-active, #{$cdr-color-background-input-default-active}));
//ITEM_DOC: Box-shadow color of the cdr-input label in hover, active, focus, and focus-within states
//ITEM_DOC: Box-shadow color of the cdr-input label in hover, active, focus, and focus-within states
box-shadow: inset 0 0 0 2px var(--cdr-input-label-box-shadow-interaction, var(--cdr-color-border-input-default-focus, #{$cdr-color-border-input-default-focus}));
outline: none;
//ITEM_DOC: Fill color of the cdr-input label in hover, active, focus, and focus-within states
//ITEM_DOC: Fill color of the cdr-input label in hover, active, focus, and focus-within states
fill: var(--cdr-input-label-fill-interaction, var(--cdr-color-text-primary, #{$cdr-color-text-primary}));
svg {
box-shadow: none;
Expand Down Expand Up @@ -64,7 +64,7 @@

&--focus {
svg {
//ITEM_DOC: Fill color of the cdr-input SVG when the parent is focused
//ITEM_DOC: Fill color of the cdr-input SVG when the parent is focused
fill: var(--cdr-input-svg-fill-focus, var(--cdr-color-text-primary, #{$cdr-color-text-primary})) !important;
}
}
Expand Down Expand Up @@ -175,6 +175,6 @@
.cdr-input-wrap {
position: relative;
flex-grow: 1;
//ITEM_DOC: Fill color of the cdr-input wrapper
//ITEM_DOC: Fill color of the cdr-input wrapper
fill: var(--cdr-input-wrap-fill, var(--cdr-color-icon-default, #{$cdr-color-icon-default}));
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrLabelStandalone.vars.scss';

.cdr-label-standalone {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrLabelWrapper.vars.scss';

.cdr-label-wrapper {
Expand Down
2 changes: 1 addition & 1 deletion src/components/link/styles/CdrLink.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
:Style variants
:Standalone
========================================================================== */
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrLink.vars.scss';
.cdr-link {
@include cdr-link-base-mixin;
Expand Down
2 changes: 1 addition & 1 deletion src/components/list/styles/CdrList.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrList.vars.scss';

.cdr-list {
Expand Down
2 changes: 1 addition & 1 deletion src/components/modal/styles/CdrModal.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';

$modal-animation-duration: 150ms;

Expand Down
9 changes: 2 additions & 7 deletions src/components/pagination/CdrPagination.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import {
useCssModule, computed, ref, watch, nextTick, onMounted,
useCssModule, computed, ref, watch, nextTick, onMounted, type PropType
} from 'vue';
import type { PropType } from 'vue';
import { paginationItem } from '../../types/interfaces';
import mapClasses from '../../utils/mapClasses';
import propValidator from '../../utils/propValidator';
import IconCaretLeft from '../icon/comps/caret-left.vue';
Expand All @@ -15,11 +15,6 @@ defineOptions({
name: 'CdrPagination'
});

interface paginationItem {
page: number,
url: string,
ellip?: boolean
}
const props = defineProps({
/**
* Define a custom slug for the generated pagination item IDs. Slug is randomly generated if no ID provided.
Expand Down
2 changes: 1 addition & 1 deletion src/components/pagination/styles/CdrPagination.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import '../../icon/styles/CdrIcon.module.scss';
@import '../../select/styles/CdrSelect.module.scss';

Expand Down
2 changes: 1 addition & 1 deletion src/components/popover/styles/CdrPopover.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
@import '../../popup/styles/CdrPopup.module.scss';
@import '../../button/styles/CdrButton.module.scss';
@import '../../icon/styles/CdrIcon.module.scss';
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';

.cdr-popover{
&--position {
Expand Down
2 changes: 1 addition & 1 deletion src/components/popup/styles/CdrPopup.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrPopup.vars.scss';

.cdr-popup {
Expand Down
2 changes: 1 addition & 1 deletion src/components/quote/styles/CdrQuote.module.scss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@import url('@rei/cedar/dist/style/cdr-text.css');
@import '../../text/styles/CdrText.module.scss';
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrQuote.vars.scss';

/* ==========================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/components/radio/styles/CdrRadio.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';
@import './vars/CdrRadio.vars.scss';
//@import url('@rei/cedar/dist/style/cdr-label-wrapper.css');
@import '../../labelWrapper/styles/CdrLabelWrapper.module.scss';
Expand Down
2 changes: 1 addition & 1 deletion src/components/rating/styles/CdrRating.module.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import '../../../styles/settings/index.scss';
@import '../../../styles/settings/_index.scss';

$rating-color: #2b6692;
$empty-star: '\2606';
Expand Down
Loading
Loading