@phila/phila-ui-core 2.1.0 → 2.1.1

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @phila/phila-ui-core
2
2
 
3
- Core utilities and styles for the Phila UI library. This package provides shared TypeScript utilities and design tokens for testing purposes.
3
+ Core utilities and styles for the Phila UI library. This package provides shared TypeScript utilities and design tokens used in the Phila UI components.
4
4
 
5
5
  ## Features
6
6
 
@@ -13,6 +13,8 @@ Core utilities and styles for the Phila UI library. This package provides shared
13
13
 
14
14
  ```bash
15
15
  pnpm add @phila/phila-ui-core
16
+ # or
17
+ npm install @phila/phila-ui-core
16
18
  ```
17
19
 
18
20
  ## Usage
@@ -69,42 +71,55 @@ import { faUser } from "@fortawesome/pro-solid-svg-icons";
69
71
  </template>
70
72
  ```
71
73
 
72
- ### Design Tokens
74
+ Additionally, you will need to configure vite.config.ts to treat the FontAwesome packages as external dependencies:
75
+
76
+ In packages/your-component/vite.config.ts:
73
77
 
74
78
  ```typescript
75
- import { colors, spacing, typography, borderRadius } from "@phila/phila-ui-core";
76
-
77
- // Use design tokens in your styles
78
- const buttonStyles = {
79
- backgroundColor: colors.primary[500],
80
- padding: spacing[4],
81
- fontSize: typography.fontSizes.base,
82
- borderRadius: borderRadius.md,
83
- };
79
+ export default defineConfig({
80
+ ...
81
+ build: {
82
+ ...
83
+ rollupOptions: {
84
+ external: ["other dependencies...", "@fortawesome/vue-fontawesome"],
85
+ ...
86
+ },
87
+ ...
88
+ },
89
+ });
84
90
  ```
85
91
 
86
- ### Class Name Utilities
92
+ And add vue-fontawesome as a peer dependency in your component's package.json:
87
93
 
88
- ```typescript
89
- import { cn } from "@phila/phila-ui-core";
94
+ ```json
95
+ "peerDependencies": {
96
+ ...
97
+ "@fortawesome/vue-fontawesome": "^3.1.2",
98
+ ...
99
+ }
100
+ ```
90
101
 
91
- // Combine class names efficiently
92
- const buttonClass = cn("base-button", "active", className);
102
+ ### Phila UI Core Styles (Light mode):
103
+
104
+ In your main.ts file, import the core styles:
105
+
106
+ ```typescript
107
+ import "@phila/phila-ui-core/styles/template-light.css";
93
108
  ```
94
109
 
95
- ### Type Definitions
110
+ ### Class Name Utilities
96
111
 
97
112
  ```typescript
98
- import type { Size, Color, Variant, StyledProps } from "@phila/phila-ui-core";
113
+ import { cn } from "@phila/phila-ui-core";
99
114
 
100
- interface ButtonProps extends StyledProps {
101
- children: React.ReactNode;
102
- onClick?: () => void;
103
- }
115
+ // Combine class names efficiently
116
+ const buttonClass = cn("base-button", "active", className);
104
117
  ```
105
118
 
106
119
  ## Design Tokens
107
120
 
121
+ The package includes essential design tokens for consistent styling across components. These tokens are defined in CSS variables and can be used directly in your styles.
122
+
108
123
  ### Colors
109
124
 
110
125
  - **Primary**: Blue shades for main actions
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components.css');const e=require("./index-DkaNsoLU.js"),y={key:0,class:"input-errors"},k=e.defineComponent({__name:"ErrorList",props:{errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},required:{type:Boolean}},setup(o){const{errors:a,isValid:r}=e.useValidation(),n=o,t=e.computed(()=>Object.assign([],a.value,n.errors||[]));return(l,c)=>!e.unref(r)&&t.value?.length?(e.openBlock(),e.createElementBlock("div",y,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(u,i)=>(e.openBlock(),e.createElementBlock("li",{key:i},e.toDisplayString(u),1))),128))])])):e.createCommentVNode("",!0)}}),d=(o,a)=>{const r=o.__vccOpts||o;for(const[n,t]of a)r[n]=t;return r},p=d(k,[["__scopeId","data-v-caba8dd2"]]),O=["for"],I={key:0,class:"required"},b=e.defineComponent({__name:"InputLabel",props:{id:{},required:{type:Boolean}},setup(o){return(a,r)=>(e.openBlock(),e.createElementBlock("label",{class:"input-label",for:a.id},[e.renderSlot(a.$slots,"default",{},void 0),a.required?(e.openBlock(),e.createElementBlock("span",I,"*")):e.createCommentVNode("",!0)],8,O))}}),v=d(b,[["__scopeId","data-v-00c91174"]]),h=e.defineComponent({inheritAttrs:!1,__name:"InputWrap",props:{id:{},name:{},placeholder:{},label:{},icon:{},required:{type:Boolean},errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},className:{}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup","keypress","error"],setup(o,{emit:a}){const{setInputValue:r}=e.useInput(),n=e.ref(""),t=o,l=a,{init:c,isValid:u,validation:i}=e.useValidation({validateOnMount:t.validateOnMount??!0,validateOnInput:t.validateOnInput??!0,validateOnBlur:t.validateOnBlur??!0,validateOnChange:t.validateOnChange??!0,required:t.required??!1,errors:t.errors||[],validate:t.validate},l),m=e.computed(()=>({invalid:!u.value})),B=s=>(n.value=s.target.value,l("update:modelValue",n.value),l("input",n.value),r(n.value),t.validateOnInput&&i(),n.value),_=()=>{t.validateOnBlur&&i(),l("blur")},f=()=>{l("focus")};return e.onBeforeMount(()=>{c()}),e.onMounted(()=>{t.validateOnMount&&i()}),(s,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrap",{hasError:!e.unref(u)}])},[t.label?(e.openBlock(),e.createBlock(v,{key:0,id:t.id,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["id","required"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",e.normalizeProps(e.guardReactiveProps({inputValue:n.value,onBlur:_,onFocus:f,onInput:B,isValid:e.unref(u),inputClasses:m.value})),void 0),e.createVNode(p)],2))}}),V=d(h,[["__scopeId","data-v-751bf20e"]]);exports.ErrorList=p;exports.InputLabel=v;exports.InputWrap=V;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./components.css');const e=require("./index-DkaNsoLU.cjs"),y={key:0,class:"input-errors"},k=e.defineComponent({__name:"ErrorList",props:{errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},required:{type:Boolean}},setup(o){const{errors:a,isValid:r}=e.useValidation(),n=o,t=e.computed(()=>Object.assign([],a.value,n.errors||[]));return(l,c)=>!e.unref(r)&&t.value?.length?(e.openBlock(),e.createElementBlock("div",y,[e.createBaseVNode("ul",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,(u,i)=>(e.openBlock(),e.createElementBlock("li",{key:i},e.toDisplayString(u),1))),128))])])):e.createCommentVNode("",!0)}}),d=(o,a)=>{const r=o.__vccOpts||o;for(const[n,t]of a)r[n]=t;return r},p=d(k,[["__scopeId","data-v-caba8dd2"]]),O=["for"],I={key:0,class:"required"},b=e.defineComponent({__name:"InputLabel",props:{id:{},required:{type:Boolean}},setup(o){return(a,r)=>(e.openBlock(),e.createElementBlock("label",{class:"input-label",for:a.id},[e.renderSlot(a.$slots,"default",{},void 0),a.required?(e.openBlock(),e.createElementBlock("span",I,"*")):e.createCommentVNode("",!0)],8,O))}}),v=d(b,[["__scopeId","data-v-00c91174"]]),h=e.defineComponent({inheritAttrs:!1,__name:"InputWrap",props:{id:{},name:{},placeholder:{},label:{},icon:{},required:{type:Boolean},errors:{},validateOnBlur:{type:Boolean},validateOnInput:{type:Boolean},validateOnChange:{type:Boolean},validateOnMount:{type:Boolean},validate:{type:Function},className:{}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup","keypress","error"],setup(o,{emit:a}){const{setInputValue:r}=e.useInput(),n=e.ref(""),t=o,l=a,{init:c,isValid:u,validation:i}=e.useValidation({validateOnMount:t.validateOnMount??!0,validateOnInput:t.validateOnInput??!0,validateOnBlur:t.validateOnBlur??!0,validateOnChange:t.validateOnChange??!0,required:t.required??!1,errors:t.errors||[],validate:t.validate},l),m=e.computed(()=>({invalid:!u.value})),B=s=>(n.value=s.target.value,l("update:modelValue",n.value),l("input",n.value),r(n.value),t.validateOnInput&&i(),n.value),_=()=>{t.validateOnBlur&&i(),l("blur")},f=()=>{l("focus")};return e.onBeforeMount(()=>{c()}),e.onMounted(()=>{t.validateOnMount&&i()}),(s,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["input-wrap",{hasError:!e.unref(u)}])},[t.label?(e.openBlock(),e.createBlock(v,{key:0,id:t.id,required:t.required},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(t.label),1)]),_:1},8,["id","required"])):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",e.normalizeProps(e.guardReactiveProps({inputValue:n.value,onBlur:_,onFocus:f,onInput:B,isValid:e.unref(u),inputClasses:m.value})),void 0),e.createVNode(p)],2))}}),V=d(h,[["__scopeId","data-v-751bf20e"]]);exports.ErrorList=p;exports.InputLabel=v;exports.InputWrap=V;
@@ -1,4 +1,4 @@
1
- import { d as c, u as m, c as y, a as l, b as v, e as p, o, f as V, F as k, r as q, t as B, g as O, h as C, i as M, j as E, k as F, l as L, m as N, n as $, p as w, q as x, w as j, s as z } from "./index-dajx1Lu4.mjs";
1
+ import { d as c, u as m, c as y, a as l, b as v, e as p, o, f as V, F as k, r as q, t as B, g as O, h as C, i as M, j as E, k as F, l as L, m as N, n as $, p as w, q as x, w as j, s as z } from "./index-dajx1Lu4.js";
2
2
  import './components.css';const P = {
3
3
  key: 0,
4
4
  class: "input-errors"
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DkaNsoLU.js");exports.useInput=e.useInput;exports.useValidation=e.useValidation;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DkaNsoLU.cjs");exports.useInput=e.useInput;exports.useValidation=e.useValidation;
@@ -1,4 +1,4 @@
1
- import { h as u, u as e } from "./index-dajx1Lu4.mjs";
1
+ import { h as u, u as e } from "./index-dajx1Lu4.js";
2
2
  export {
3
3
  u as useInput,
4
4
  e as useValidation
@@ -17,54 +17,90 @@ body {
17
17
  --Schemes-Outline: #5e5e5e;
18
18
  --Schemes-On-Surface: #000;
19
19
 
20
- --Label-font-label-family: "Montserrat", sans-serif;
20
+ /* label */
21
+ --Label-ExtraSmall-font-label-xs-family: "Montserrat", sans-serif;
22
+ --Label-ExtraSmall-font-label-xs-size: 0.75rem;
23
+ --Label-ExtraSmall-font-label-xs-lineheight: 1rem;
24
+
25
+ --Label-Default-font-label-default-family: "Montserrat", sans-serif;
21
26
  --Label-Default-font-label-default-size: 1rem;
22
- --Label-Default-font-label-default-lineheight: 1rem;
27
+ --Label-Default-font-label-default-lineheight: 1.5rem;
28
+
29
+ --Label-Large-font-label-large-family: "Montserrat", sans-serif;
30
+ --Label-Large-font-label-large-size: 1.125rem;
31
+ --Label-Large-font-label-large-lineheight: 1.75rem;
32
+
23
33
  --Label-Small-font-label-small-size: 0.875rem;
24
34
  --Label-Small-font-label-small-lineheight: 1.25rem;
25
-
26
- --Body-Default-font-body-default-family: "Montserrat";
35
+ /* Body */
36
+ --Body-Default-font-body-default-family: "Montserrat", sans-serif;
27
37
  --Body-Default-font-body-default-size: 1rem;
28
38
  --Body-Default-font-body-default-lineheight: 1.5rem;
29
39
 
30
- --Body-Small-font-body-small-family: "Montserrat";
40
+ --Body-Small-font-body-small-family: "Montserrat", sans-serif;
31
41
  --Body-Small-font-body-small-size: 0.875rem;
32
42
  --Body-Small-font-body-small-lineheight: 1.25rem;
33
43
 
34
- --Body-Large-font-body-large-family: "Montserrat";
44
+ --Body-Large-font-body-large-family: "Montserrat", sans-serif;
35
45
  --Body-Large-font-body-large-size: 1.125rem;
36
46
  --Body-Large-font-body-large-lineheight: 1.75rem;
37
47
 
38
- --Body-ExtraLarge-font-body-xlarge-family: "Montserrat";
48
+ --Body-ExtraLarge-font-body-xlarge-family: "Montserrat", sans-serif;
39
49
  --Body-ExtraLarge-font-body-xlarge-size: 1.5rem;
40
50
  --Body-ExtraLarge-font-body-xlarge-lineheight: 2.25rem;
51
+ /* Headings */
52
+ --Heading-H1-font-heading-1-family: "Montserrat", sans-serif;
53
+ --Heading-H1-font-heading-1-size: 3rem;
54
+ --Heading-H1-font-header-1-lineheight: 4rem;
55
+
56
+ --Heading-H2-font-heading-2-family: "Montserrat", sans-serif;
57
+ --Heading-H2-font-heading-2-size: 2.25rem;
58
+ --Heading-H2-font-heading-2-lineheight: 3rem;
59
+
60
+ --Heading-H3-font-heading-3-family: "Montserrat", sans-serif;
61
+ --Heading-H3-font-heading-3-size: 2rem;
62
+ --Heading-H3-font-heading-3-lineheight: 2.5rem;
63
+
64
+ --Heading-H4-font-heading-4-family: "Montserrat", sans-serif;
65
+ --Heading-H4-font-heading-4-size: 1.5rem;
66
+ --Heading-H4-font-heading-4-lineheight: 2.25rem;
67
+
68
+ --Heading-H5-font-heading-5-family: "Montserrat", sans-serif;
69
+ --Heading-H5-font-heading-5-size: 1.25rem;
70
+ --Heading-H5-font-heading-5-lineheight: 1.75rem;
71
+
72
+ --Heading-H6-font-heading-6-family: "Montserrat", sans-serif;
73
+ --Heading-H6-font-heading-6-size: 1rem;
74
+ --Heading-H6-font-heading-6-lineheight: 1.5rem;
75
+ /* Subtitles */
76
+ --Subtitle-font-subtitle-family: "Montserrat", sans-serif;
77
+ --Subtitle-Subtitle-1-font-subtitle-1-size: 1.5rem;
78
+ --Subtitle-Subtitle-1-font-subtitle-1-lineheight: 2.25rem;
79
+
80
+ --Subtitle-Subtitle-2-font-subtitle-2-size: 1.25rem;
81
+ --Subtitle-Subtitle-2-font-subtitle-2-lineheight: 1.75rem;
82
+ /* Display */
83
+ --Display-font-display-family: Montserrat, sans-serif;
84
+ --Display-Display-1-font-display-1-size: 4.5rem;
85
+ --Display-Display-1-font-display-1-lineheight: 5.5rem;
86
+
87
+ --Display-Display-2-font-display-2-size: 3.5rem;
88
+ --Display-Display-2-font-display-2-lineheight: 4.5rem;
89
+
90
+ /* Quotes */
91
+ --Quote-font-quote-family: "Times New Roman", serif;
92
+ --Quote-font-quote-size: 1.5rem;
93
+ --Quote-font-quote-lineheight: 2.25rem;
41
94
 
95
+ /* Icons */
42
96
  --Icon-Solid-Small-font-icon-solid-small-size: 1rem;
43
97
  --Icon-Solid-Default-font-icon-solid-default-size: 1.5rem;
44
98
  --Icon-Solid-Large-font-icon-solid-large-size: 2.25rem;
45
99
  --Icon-Solid-ExtraLarge-font-icon-solid-xl-size: 3rem;
46
100
  --Icon-Solid-XXSmall-font-icon-solid-xxs-size: 0.75rem;
47
101
 
48
- --scale-xxsmall: 0.125rem;
49
- --scale-xsmall: 0.25rem;
50
- --scale-small: 0.5rem;
51
- --scale-large: 1rem;
52
- --scale-6xlarge: 3.5rem;
53
-
54
102
  --Static-Body-Large-Font: "Roboto", sans-serif;
55
103
  --Static-Body-Large-Size: 1rem;
56
104
  --Static-Body-Large-Line-Height: 1.5rem;
57
105
  --Static-Body-Large-Tracking: 0.03125rem;
58
- --Display-font-display-family: "Montserrat";
59
- --Display-Display-1-font-display-1-size: 4.5rem;
60
- --Display-Display-1-font-display-1-lineheight: 5.5rem;
61
- --scale-xxsmall: 0.125rem;
62
- --scale-xsmall: 0.25rem;
63
- --scale-small: 0.5rem;
64
- --scale-large: 1rem;
65
- --scale-6xlarge: 3.5rem;
66
-
67
- --Display-Display-2-font-display-2-size: 3.5rem;
68
- --Display-Display-2-font-display-2-lineheight: 4.5rem;
69
- --Display-Display-3-font-display-3-size: 2.5rem;
70
106
  }
@@ -1,4 +1,4 @@
1
- *:focus {
2
- outline-offset: var(--spacing-xs);
3
- outline: var(--stroke-stroke-thin, 2px) solid var(--Schemes-Primary-Container);
1
+ body {
2
+ font-size: 100%;
3
+ text-rendering: optimizeLegibility;
4
4
  }
@@ -2,5 +2,5 @@
2
2
  @import "./light-mode.css";
3
3
  @import "./typography.css";
4
4
  @import "./main.css";
5
- @import "./utilities.css";
6
- @import "./button.css";
5
+ @import "./utilities/index.css";
6
+ @import "./elements/index.css";
@@ -1,24 +1,22 @@
1
- @font-face {
2
- font-family: "Montserrat";
3
- src:
4
- local("Montserrat Regular"),
5
- local("Montserrat-Regular"),
6
- url("https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff2") format("woff2"),
7
- url("https://www.phila.gov/assets/fonts/Montserrat/Montserrat-Regular.woff") format("woff");
8
- font-weight: normal;
9
- font-style: normal;
10
- }
1
+ @import url("https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,699;1,400;1,600&display=swap");
11
2
 
12
- .default-font,
13
- .content {
14
- font-family: var(--Body-Default-font-body-default-family);
15
- font-size: var(--Body-Default-font-body-default-size);
16
- font-style: normal;
17
- }
18
3
  /**
19
4
  TODO: figma not clear on margins between headings / paragraphs, or how these elements interact with each other
20
5
  **/
21
6
  .content {
7
+ /* Reset, based on https://www.joshwcomeau.com/css/custom-css-reset */
8
+ line-height: 1.5rem;
9
+ -webkit-font-smoothing: antialiased;
10
+ color: var(--Schemes-On-Surface);
11
+ *,
12
+ *::before,
13
+ *::after {
14
+ box-sizing: border-box;
15
+ }
16
+ * {
17
+ margin: 0;
18
+ }
19
+
22
20
  p,
23
21
  h1,
24
22
  h2,
@@ -26,8 +24,123 @@ TODO: figma not clear on margins between headings / paragraphs, or how these ele
26
24
  h4,
27
25
  h5,
28
26
  h6 {
29
- color: var(--Schemes-On-Surface);
27
+ overflow-wrap: break-word;
28
+ font-style: normal;
29
+ }
30
+ h1,
31
+ h2,
32
+ h3,
33
+ h4,
34
+ h5,
35
+ h6 {
36
+ text-wrap: balance;
37
+ }
38
+
39
+ p {
40
+ text-wrap: pretty;
41
+ }
42
+
43
+ /* Body text */
44
+
45
+ p {
46
+ font-family: var(--Body-Default-font-body-default-family);
47
+ font-weight: 400;
48
+ line-height: var(--Body-Default-font-body-default-lineheight);
49
+ &:not([class^="has-text-"]):not([class*=" has-text-"]),
50
+ &.has-text-body-small {
51
+ margin: 0 0 var(--spacing-l) 0;
52
+ }
53
+ &.has-text-body-large {
54
+ margin: 0 0 var(--spacing-xl) 0;
55
+ }
56
+ &.has-text-body-extra-large {
57
+ margin: 0 0 var(--spacing-xxl) 0;
58
+ }
59
+ }
60
+
61
+ /* Headings */
62
+ h1 {
63
+ font-family: var(--Heading-H1-font-heading-1-family);
64
+ font-size: var(--Heading-H1-font-heading-1-size);
30
65
  font-weight: 600;
31
- margin: 0;
66
+ line-height: var(--Heading-H1-font-header-1-lineheight);
67
+ margin: var(--spacing-xxl) 0;
68
+ }
69
+
70
+ h2 {
71
+ font-family: var(--Heading-H2-font-heading-2-family);
72
+ font-size: var(--Heading-H2-font-heading-2-size);
73
+ font-style: normal;
74
+ font-weight: 600;
75
+ line-height: var(--Heading-H2-font-heading-2-lineheight);
76
+ margin: var(--spacing-l) 0 var(--spacing-xxl) 0;
77
+ }
78
+ h3 {
79
+ font-family: var(--Heading-H3-font-heading-3-family);
80
+ font-size: var(--Heading-H3-font-heading-3-size);
81
+ font-style: normal;
82
+ font-weight: 600;
83
+ line-height: var(--Heading-H3-font-heading-3-lineheight);
84
+ margin: var(--spacing-l) 0 var(--spacing-xxl) 0;
85
+ }
86
+ h4 {
87
+ font-family: var(--Heading-H4-font-heading-4-family);
88
+ font-size: var(--Heading-H4-font-heading-4-size);
89
+ font-style: normal;
90
+ font-weight: 600;
91
+ line-height: var(--Heading-H4-font-heading-4-lineheight);
92
+ margin: var(--spacing-l) 0;
93
+ }
94
+ h5 {
95
+ font-family: var(--Heading-H5-font-heading-5-family);
96
+ font-size: var(--Heading-H5-font-heading-5-size);
97
+ font-style: normal;
98
+ font-weight: 600;
99
+ line-height: var(--Heading-H5-font-heading-5-lineheight);
100
+ margin: var(--spacing-l) 0;
101
+ }
102
+ h6 {
103
+ font-family: var(--Heading-H6-font-heading-6-family);
104
+ font-size: var(--Heading-H6-font-heading-6-size);
105
+ font-style: normal;
106
+ font-weight: 600;
107
+ line-height: var(--Heading-H6-font-heading-6-lineheight);
108
+ margin: var(--spacing-l) 0;
109
+ }
110
+
111
+ /* Quotes */
112
+
113
+ blockquote {
114
+ font-family: var(--Quote-font-quote-family);
115
+ font-size: var(--Quote-font-quote-size);
116
+ font-style: italic;
117
+ font-weight: 700;
118
+ line-height: var(--Quote-font-quote-lineheight);
119
+ margin: 0 0 var(--spacing-l) 0;
120
+ }
121
+
122
+ /* lists */
123
+
124
+ ul,
125
+ ol {
126
+ margin: var(--spacing-l) 0 0 0;
127
+ padding: 0 0 0 var(--spacing-3xl);
128
+ li {
129
+ margin: 0 0 var(--spacing-l) 0;
130
+ padding: 0 0 0 var(--spacing-s);
131
+ }
132
+ &:not(:last-child) {
133
+ margin-bottom: var(--spacing-l);
134
+ }
135
+ }
136
+
137
+ /* Others */
138
+ b,
139
+ strong {
140
+ font-weight: 600;
141
+ }
142
+ em,
143
+ cite {
144
+ font-style: italic;
32
145
  }
33
146
  }
@@ -50,8 +50,8 @@ TODO: we will need to update tokens.json to a more complete and updated version
50
50
  /* Colors/Mode 1 > Status */
51
51
  --status-green-light: #05ff47;
52
52
  /* Primitives/Mode 1 > spacing */
53
- --spacing-xs: 0.25rem;
54
53
  --spacing-xxs: 0.125rem;
54
+ --spacing-xs: 0.25rem;
55
55
  --spacing-s: 0.5rem;
56
56
  --spacing-m: 0.75rem;
57
57
  --spacing-l: 1rem;
@@ -63,12 +63,15 @@ TODO: we will need to update tokens.json to a more complete and updated version
63
63
  --spacing-6xl: 3.5rem;
64
64
  --spacing-7xl: 4rem;
65
65
  /* scale, these are new from figma, assumptions made on medium -> large */
66
+ --scale-xxsmall: 0.125rem;
66
67
  --scale-xsmall: 0.25rem;
67
68
  --scale-small: 0.5rem;
68
69
  --scale-medium: 0.75rem;
69
70
  --scale-large: 1rem;
70
71
  --scale-xlarge: 1.125rem;
71
72
  --scale-xxlarge: 1.5rem;
73
+ --scale-3xlarge: 2rem;
74
+ --scale-6xlarge: 3.5rem;
72
75
  /* Primitives/Mode 1 > border widths */
73
76
  --border-width-xl: 1.125rem;
74
77
  --border-width-l: 1rem;
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@phila/phila-ui-core",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
+ "type": "module",
4
5
  "description": "Core utilities and styles for Phila UI library",
5
6
  "main": "./dist/index.js",
6
7
  "module": "./dist/index.mjs",
@@ -1,233 +0,0 @@
1
- .phila-button {
2
- /* --- Base styles --- */
3
- display: inline-flex;
4
- justify-content: center;
5
- align-items: center;
6
- flex-shrink: 0;
7
- cursor: pointer;
8
- overflow: hidden;
9
- white-space: nowrap;
10
-
11
- /* --- Text styles --- */
12
- color: var(--Schemes-On-Primary-Container);
13
- font-family: var(--Label-font-label-family, Montserrat);
14
- font-size: var(--Label-Default-font-label-default-size, 1rem);
15
- font-style: normal;
16
- font-weight: 600;
17
- line-height: var(--Label-Default-font-label-default-lineheight);
18
-
19
- /* --- Reset button --- */
20
- border: none;
21
- /* Corrects font smoothing for webkit */
22
- -webkit-font-smoothing: inherit;
23
- -moz-osx-font-smoothing: inherit;
24
- /* Corrects inability to style clickable `input` types in iOS */
25
- appearance: none;
26
- -webkit-appearance: none;
27
-
28
- /* --- Sizing --- */
29
- height: var(--spacing-6xl, 3.25rem);
30
- max-width: 18.75rem;
31
- padding: var(--spacing-l, 0.5rem) var(--spacing-3xl);
32
- gap: var(--spacing-s);
33
-
34
- &.is-medium {
35
- height: var(--spacing-5xl, 3rem);
36
- padding: var(--spacing-m, 0.75rem) var(--spacing-xxl);
37
- gap: var(--spacing-s);
38
- }
39
- &.is-small {
40
- height: var(--spacing-3xl);
41
- padding: var(--spacing-s) var(--spacing-l);
42
- gap: var(--spacing-s);
43
- }
44
- &.is-extra-small:not(.icon-button) {
45
- color: var(--Schemes-Primary-Container);
46
- height: var(--spacing-xxl);
47
- padding: var(--spacing-xxs);
48
- gap: var(--spacing-xxs);
49
- background-color: var(--Schemes-Surface-Container-Lowest) !important;
50
- font-family: var(--Label-font-label-family, Montserrat);
51
- font-size: var(--Label-Small-font-label-small-size);
52
- font-style: normal;
53
- font-weight: 600;
54
- line-height: var(--Label-Small-font-label-small-lineheight);
55
- border-color: var(--Schemes-Surface-Container-Lowest);
56
- border-width: var(--spacing-xxs);
57
- border-style: solid;
58
- box-sizing: border-box;
59
- border-left: none;
60
- border-right: none;
61
- &:focus:not(:disabled),
62
- &:hover:not(:disabled) {
63
- --Schemes-On-Primary-Container: --Schemes-Inverse-Surface;
64
- color: var(--Schemes-Inverse-Surface) !important;
65
- border-bottom-color: var(--Schemes-Inverse-Surface) !important;
66
- }
67
- &:active:not(:disabled) {
68
- color: var(--Schemes-Secondary-Container) !important;
69
- box-sizing: border-box;
70
- border: none;
71
- }
72
- &:disabled {
73
- color: var(--Schemes-Surface-Container-High);
74
- }
75
- &.phila-button--destructive:not(:active) {
76
- color: var(--Schemes-Error-Container);
77
- }
78
- }
79
- /* --- States --- */
80
- &:hover:not(:disabled):not(.is-extra-small),
81
- &:focus:not(:disabled):not(.is-extra-small),
82
- &.icon-button:hover:not(:disabled),
83
- &.icon-button:focus:not(:disabled) {
84
- &:not(:active):not(.phila-button--secondary):not(.icon-button--standard) {
85
- background: var(--Schemes-Inverse-Surface) !important;
86
- color: var(--Schemes-On-Primary-Container) !important;
87
- }
88
- }
89
- &:active:not(:disabled):not(.is-extra-small) {
90
- color: var(--Schemes-On-Primary-Container) !important;
91
- background: var(--Schemes-Secondary-Container) !important;
92
- }
93
- &:disabled {
94
- background: var(--Schemes-Surface-Container-High) !important;
95
- cursor: not-allowed;
96
- }
97
-
98
- /* --- Variants --- */
99
- &.phila-button--primary:not(:disabled) {
100
- background: var(--Schemes-Primary-Container);
101
- }
102
-
103
- &.phila-button--secondary:not(:disabled) {
104
- color: var(--Schemes-Primary);
105
- background: var(--Schemes-Surface-Container-Lowest);
106
- &:not(:active) {
107
- border: var(--spacing-xxs) solid var(--Schemes-Primary);
108
- }
109
- &:active:not(:disabled):not(.is-extra-small) {
110
- border-right: var(--spacing-xxs) solid var(--Schemes-Surface-Container-Lowest);
111
- border-left: var(--spacing-xxs) solid var(--Schemes-Surface-Container-Lowest);
112
- }
113
- &:hover:not(:disabled),
114
- &:focus:not(:disabled) {
115
- color: var(--Schemes-On-Primary-Container);
116
- background: var(--Schemes-Inverse-Surface);
117
- }
118
- }
119
-
120
- &.phila-button--destructive:not(:disabled) {
121
- &:not(.is-extra-small) {
122
- background: var(--Schemes-Error-Container);
123
- }
124
- }
125
-
126
- /* --- Icons --- */
127
- /* TODO: break out to separate class for use outside of buttons */
128
- &.icon-button {
129
- padding: var(--spacing-xl);
130
- height: 5rem;
131
- width: 5rem;
132
- span.icon {
133
- font-size: var(--Icon-Solid-ExtraLarge-font-icon-solid-xl-size);
134
- font-style: normal;
135
- font-weight: 900;
136
- line-height: normal;
137
- }
138
-
139
- &.is-large {
140
- height: 3.75rem;
141
- width: 3.75rem;
142
- padding: var(--spacing-m);
143
- gap: var(--spacing-s);
144
- span.icon {
145
- font-size: var(--Icon-Solid-Large-font-icon-solid-large-size);
146
- }
147
- }
148
- &.is-medium {
149
- height: 3rem;
150
- width: 3rem;
151
- padding: var(--spacing-m);
152
- gap: var(--spacing-s);
153
- span.icon {
154
- font-size: var(--Icon-Solid-Default-font-icon-solid-default-size);
155
- }
156
- }
157
- &.is-small {
158
- height: 2rem;
159
- width: 2rem;
160
- padding: var(--spacing-s);
161
- gap: var(--spacing-s);
162
- span.icon {
163
- font-size: var(--Icon-Solid-Small-font-icon-solid-small-size);
164
- }
165
- }
166
- &.is-extra-small {
167
- width: 1.5rem;
168
- height: 1.5rem;
169
- padding: var(--scale-xsmall);
170
- gap: var(--scale-small);
171
- span.icon {
172
- font-size: var(--Icon-Solid-XXSmall-font-icon-solid-xxs-size);
173
- }
174
- }
175
- &.icon-button--standard:not(:disabled) {
176
- color: var(--Schemes-Primary, #003282);
177
- background: var(--Schemes-Surface-Container-Lowest);
178
- }
179
- &.phila-button--destructive:not(:disabled) {
180
- color: var(--Schemes-On-Error-Container) !important;
181
- background: var(--Schemes-Error-Container);
182
- }
183
- &:active:not(:disabled) {
184
- color: var(--Schemes-On-Secondary-Container) !important;
185
- background: var(--Schemes-Secondary-Container) !important;
186
- box-sizing: border-box;
187
- border: none;
188
- }
189
- &:hover:not(:disabled),
190
- &:focus:not(:disabled) {
191
- &.phila-button--secondary,
192
- &.icon-button--standard {
193
- color: var(--Schemes-Primary);
194
- background: var(--Schemes-Surface-Container);
195
- border-color: transparent;
196
- }
197
- }
198
- }
199
-
200
- span.icon {
201
- height: auto;
202
- width: auto;
203
- font-style: normal;
204
- font-weight: 900;
205
- line-height: normal;
206
- font-size: var(--Icon-Solid-Small-font-icon-solid-small-size);
207
- }
208
-
209
- span.icon:first-child:not(:last-child) {
210
- margin-left: 0;
211
- margin-right: var(--spacing-s);
212
- + span {
213
- padding-right: var(--spacing-s);
214
- }
215
- }
216
- span.icon:last-child:not(:first-child) {
217
- margin: 0;
218
- padding: 0;
219
- }
220
- span:not([class="icon"]:only-child) {
221
- padding: 0 !important;
222
- }
223
- span:first-child:not([class="icon"]) {
224
- margin-left: 0 !important;
225
- margin-right: 0 !important;
226
- padding-left: var(--spacing-s);
227
- text-overflow: ellipsis;
228
- overflow: hidden;
229
- + span {
230
- margin-left: var(--spacing-s) !important;
231
- }
232
- }
233
- }
@@ -1,43 +0,0 @@
1
- /* TODO: create rest of color utility classes */
2
- .has-background-ben-franklin-blue {
3
- background-color: var(--dark-ben-franklin-blue);
4
- }
5
-
6
- .has-label-small-text {
7
- /* Label/Small */
8
- font-family: var(--Label-font-label-family);
9
- font-size: var(--Label-Small-font-label-small-size);
10
- font-style: normal;
11
- font-weight: 600;
12
- line-height: var(--Label-Small-font-label-small-lineheight);
13
- }
14
-
15
- .has-body-default-text {
16
- /* Body/Default */
17
- font-family: var(--Body-Default-font-body-default-family);
18
- font-size: var(--Body-Default-font-body-default-size);
19
- font-style: normal;
20
- font-weight: 400;
21
- line-height: var(--Body-Default-font-body-default-lineheight);
22
- }
23
-
24
- .has-body-small-text {
25
- /* Body/Small */
26
- font-family: var(--Body-Small-font-body-small-family);
27
- font-size: var(--Body-Small-font-body-small-size);
28
- font-style: normal;
29
- font-weight: 400;
30
- line-height: var(--Body-Small-font-body-small-lineheight);
31
- }
32
- .has-text-display-1 {
33
- font-family: var(--Display-font-display-family);
34
- font-size: var(--Display-Display-1-font-display-1-size);
35
- font-weight: 600;
36
- line-height: var(--Display-Display-1-font-display-1-lineheight);
37
- }
38
- .has-text-display-2 {
39
- font-family: var(--Display-font-display-family, Montserrat);
40
- font-size: var(--Display-Display-2-font-display-2-size);
41
- font-weight: 600;
42
- line-height: var(--Display-Display-2-font-display-2-lineheight);
43
- }
File without changes
File without changes