153 | ```
154 |
155 |
156 | ### Selects
157 |
158 | Native selects don't have a component version. Just use as is.
159 |
160 | ```example
161 |
167 | ```
--------------------------------------------------------------------------------
/docs_src/src/pages/components/grid.md:
--------------------------------------------------------------------------------
1 |
Grid
2 |
3 | ```example script:hide
4 |
7 |
8 |
.col
9 |
10 |
11 |
.col
12 |
.col
13 |
.col
14 |
15 | ```
16 |
17 | ### Size
18 |
19 | You can specify the size of the columns. The `size` property can be *from 1 to 12*.
20 |
21 | Each column's size is specified by how many columns you want out of 12. So if you want 4 columns out of 12, use `size="4"`.
22 |
23 | ```example script:hide
24 |
27 |
28 | {#each [1,2,3,4,5,6,7,8,9,10,11,12] as i}
29 |
.col
41 |
42 | ```
43 |
44 | ### Responsive grids
45 |
46 | We now have responsive grids that work based on device width.
47 |
48 | * All columns are 100% for device width under 600px
49 | * `size` for all device sizes >= 600px
50 | * `sizeMD` for >= 900px sizes
51 | * `sizeLG` for >= 1200px sizes
52 |
53 | ```example script:hide
54 |
57 |
58 |
12 / 6 / 4
59 |
6 / 3 / 4
60 |
6 / 3 / 4
61 |
62 |
63 |
64 |
6 on lg
65 |
3 on lg
66 |
3 on lg
67 |
68 | ```
69 |
70 |
71 | ### Mix-n-Match
72 |
73 | You can use a combination of flexible and sized columns.
74 |
75 | When using a combination, the sized column takes the space specified and the remaining space is filled by the flexible column.
76 |
77 | ```example script:hide
78 |
81 |
82 |
col 2
83 |
col 2
84 |
auto
85 |
col 3
86 |
87 |
88 |
89 |
col 10
90 |
auto
91 |
92 |
93 |
94 |
auto
95 |
auto
96 |
97 |
auto
98 |
auto
99 |
100 | ```
101 |
102 | > **Pro tip:** Create equal-width columns that span multiple rows by inserting `.is-full-width` (one of the [utility class](utilites)) where you want the columns to break to a new line.
103 |
104 |
105 | ### Reverse Direction
106 |
107 | Add the `reverse` property to the `Row` to reverse the column direction.
108 |
109 | ```example script:hide
110 |
113 |
114 |
col 5
115 |
col 4
116 |
col 3
117 |
118 | ```
119 |
--------------------------------------------------------------------------------
/docs_src/src/pages/components/icon.md:
--------------------------------------------------------------------------------
1 | # Icon
2 |
3 | ### Source
4 |
5 | A `src` property can be either an *SVG-path*, *SVG sprite URL with symbol ID* or *SVG image URL*.
6 |
7 | * *SVG-paths* are provided by many npm packages. For example you can use [@mdi/js](https://www.npmjs.com/package/@mdi/js) and choose from hundreds of material icons on [materialdesignicons.com](https://materialdesignicons.com/). Or you can use your own SVG-path.
8 |
9 | * *SVG sprite URL with symbol ID* is a path to the SVG-sprite with a specified symbol name. There are a lot of tools to bundle many SVG-files in a single SVG-sprite. For example, you can look at the [rollup-plugin-svg-icons](https://www.npmjs.com/package/rollup-plugin-svg-icons) package.
10 |
11 | * *SVG image's URL* is a path to an image which might be located in your assets or in any public libraries
12 | like [icongr.am](https://icongr.am/).
13 |
14 |
15 | ```example
16 |
32 |
33 |
34 |
35 |
36 |
37 | ```
38 |
39 | ### Size
40 |
41 | You can set the `size` property with a CSS-string like `36px` or just a multiplier for the icon's default size.
42 |
43 | ```example script:hide
44 |
47 |
48 |
49 |
50 |
51 |
52 | ```
53 |
54 |
55 | ### Color
56 |
57 | By default, icon color is inherited from the current text color. But you can specify any color you want.
58 |
59 | > **Note:** a `color` property can only be used when the source is *SVG-path* or *SVG sprite*!
60 |
61 | ```example
62 |
66 |
67 |
68 |
69 |
70 |
71 | ```
72 |
73 | ### Rotate
74 |
75 | The `rotate` property is a number of degrees from -360 to 360.
76 |
77 | ```example script:hide
78 |
81 |
82 |
83 |
84 |
85 |
86 | ```
87 |
88 |
89 | ### Flip
90 |
91 | You can flip an icon vertically with the `flipV` property or horizontally with `flipH`.
92 |
93 | ```example script:hide
94 |
97 |
98 |
99 |
100 |
101 | ```
102 |
103 | ### Spin
104 |
105 | It is possible to make a spinning icon. `spin` is the duration of the full turn in seconds. Default is 2 seconds.
106 |
107 | If the value is *positive* then the icon will spin clockwise, and counterclockwise if it is *negative*
108 |
109 | ```example script:hide
110 |
113 |
114 |
115 |
116 |
117 |
118 |
119 | ```
--------------------------------------------------------------------------------
/docs_src/src/pages/components/modal.md:
--------------------------------------------------------------------------------
1 | # Modal
2 |
3 | ```example height:200
4 |
8 |
9 | modal_open = true}>Show modal
10 |
11 |
12 | Hello, I am a simple modal.
13 |
14 |
15 | ```
16 |
17 |
18 | ```example height:300
19 |
25 |
26 | Show modal
27 |
28 |
29 |
Destroy the world
30 |
31 |
Are you sure?
32 |
33 |
34 | Cancel
35 | Confirm
36 |
37 |
38 |
39 | ```
40 |
--------------------------------------------------------------------------------
/docs_src/src/pages/components/nav.md:
--------------------------------------------------------------------------------
1 | # Nav
2 |
3 |
4 | ```example script:hide
5 |
8 |
9 |
18 | ```
19 |
20 | ```example script:hide
21 |
24 |
25 |
30 | ```
--------------------------------------------------------------------------------
/docs_src/src/pages/components/tabs.md:
--------------------------------------------------------------------------------
1 | # Tabs
2 |
3 | ### Simple usage
4 |
5 | ```example
6 |
10 |
11 |
12 | Tab1
13 | Tab2
14 | Tab3
15 |
16 |
17 | Current active tab: {active_tab}
18 | ```
19 |
20 |
21 |
22 | ### Property: tabid
23 |
24 | ```example
25 |
29 |
30 |
31 | Tab1
32 | Tab2
33 | Tab3
34 |
35 |
36 | Current active tab: {active_tab}
37 | ```
38 |
39 |
40 | ### Full width
41 |
42 | ```example script:hide
43 |
46 |
47 |
48 | Tab1
49 | Tab2
50 | Tab3
51 |
52 | ```
--------------------------------------------------------------------------------
/docs_src/src/pages/components/tag.md:
--------------------------------------------------------------------------------
1 | # Tag
2 |
3 | ```example script:hide
4 |
7 | One
8 | Two
9 | Three
10 | Small
11 | Large
12 | ```
--------------------------------------------------------------------------------
/docs_src/src/pages/customization.md:
--------------------------------------------------------------------------------
1 | # Customization
2 |
3 | [chota](https://jenil.github.io/chota/) is customized by setting CSS variables. See [official docs](https://jenil.github.io/chota/#customizing) for more info.
4 |
5 | You can set CSS variables in an external _*.css_ file or inside `App.svelte` using the `:global` modifier.
6 |
7 | ```svelte
8 |
22 | ```
--------------------------------------------------------------------------------
/docs_src/src/pages/elements.md:
--------------------------------------------------------------------------------
1 | # Elements
2 |
3 | You can find how common HTML-elements look with [chota](https://jenil.github.io/chota/) on the [Demo page](https://cdn.rawgit.com/jenil/chota/master/test/index.html).
4 |
5 | Feel free to look at the demo page's source code for more info about their composition.
6 |
--------------------------------------------------------------------------------
/docs_src/src/pages/getting-started.md:
--------------------------------------------------------------------------------
1 | # About my component
2 |
3 | It is a very cool button.
4 |
5 | ## Installation
6 |
7 | Run this command:
8 |
9 | ```shell
10 | $ npm install -D my-svelte-button
11 | ```
12 |
13 | Then you can import it in your projects:
14 |
15 | ```html
16 |
19 | ```
20 |
--------------------------------------------------------------------------------
/docs_src/src/pages/index.md:
--------------------------------------------------------------------------------
1 | ---
2 | title: false
3 | layout: 'no_sidebar'
4 | ---
5 |
6 |
7 | # Svelte-Chota #
8 |
9 |
10 |
11 | UI component library for [Svelte](https://svelte.dev) built with tiny [chota.css](https://jenil.github.io/chota/)
12 |
17 |
18 |
--------------------------------------------------------------------------------
/docs_src/src/pages/install.md:
--------------------------------------------------------------------------------
1 | import Details from '@INCLUDES/Details.svelte';
2 |
3 | # Installation
4 |
5 | You have two ways to start working with `chota` and `svelte-chota`. These instructions apply to the official [svelte template](https://github.com/sveltejs/template).
6 |
7 |
8 |
11 |
12 | 1. Install two node packages for development:
13 |
14 | * `chota` - css framework itself
15 | * `svelte-chota` - Svelte components for chota
16 |
17 | ```shell
18 | $ npm install --save-dev chota svelte-chota
19 | ```
20 |
21 | 2. Open your root component file (usually `App.svelte`) and add the `chota` import at the top of a `
28 | ```
29 |
30 |
31 |
32 |
33 |
37 |
38 | Another way to import `chota` without Rollup's config changing is using CDN. In this case an internet connection is required for users of your app.
39 |
40 | 1. Install `svelte-chota` for production:
41 |
42 | ```shell
43 | $ npm install --save-prod svelte-chota
44 | ```
45 |
46 | 2. Import styles from chota's CDN in the `style` block of the your `App.svelte`.
47 |
48 | ```html
49 |
52 | ```
53 |
54 | > This way is ideal for use in sandboxes. See example on the [REPL](https://svelte.dev/repl/23f96be8ef424e12b584f9ed00761e88)
55 |
56 |
--------------------------------------------------------------------------------
/docs_src/src/pages/usage.md:
--------------------------------------------------------------------------------
1 | # Usage
2 |
3 | Just import the necessary components from the `svelte-chota` package inside your components.
4 |
5 | ```svelte
6 |
9 |
10 | Find
11 | ```
12 |
13 |
14 | ### Events handlers
15 |
16 | You can use any `on:eventname` directive with any component.
17 |
18 | ```example
19 |
23 |
24 | button_text="Don't touch me!" }
26 | on:mouseleave={ e => button_text="Ok, hover over me again" }
27 | >{button_text}
28 | ```
29 |
30 |
31 | ### Attributes
32 |
33 | Any attribute can be passed to the component, even the `class` attribute.
34 |
35 | ```example
36 |
39 |
40 |
45 |
Hey!
46 |
47 | ```
--------------------------------------------------------------------------------
/docs_src/src/pages/utilites.md:
--------------------------------------------------------------------------------
1 | # Utilites
2 |
3 | [chota](https://jenil.github.io/chota/) has very useful CSS classes. You can apply these helper classes to almost any element in order to alter its style.
4 |
5 |
6 | * `text-primary` - Primary text
7 | * `text-light` - Light text
8 | * `text-white` - White text
9 | * `text-dark` - Dark text
10 | * `text-grey` - Grey text
11 | * `text-error` - Error text
12 | * `text-success` - Success text
13 | * `bg-primary` - primary background
14 | * `bg-light` - Light background
15 | * `bg-dark` - Dark background
16 | * `bg-grey` - Grey background
17 | * `bg-error` - Error background
18 | * `bg-success` - Success background
19 | * `bd-primary` - primary border
20 | * `bd-light` - Light border
21 | * `bd-dark` - Dark border
22 | * `bd-grey` - Grey border
23 | * `bd-error` - Error border
24 | * `bd-success` - Success border
25 | * `pull-right` - floats an element to the right
26 | * `pull-left` - floats an element to the left
27 | * `text-center` - center aligns text
28 | * `text-left` - left aligns text
29 | * `text-right` - right aligns text
30 | * `text-justify` - justify aligns text
31 | * `text-uppercase` - text to uppercase
32 | * `text-lowercase` - text to lowercase
33 | * `text-capitalize` - capitalizes text
34 | * `is-full-screen` - makes the element 100% view height
35 | * `is-full-width` - make the element 100% width
36 | * `is-vertical-align` - vertically centers element using flex
37 | * `is-horizontal-align` - horizontal centers element using flex
38 | * `is-center` - centers element using flex
39 | * `is-right` - right aligns element using flex
40 | * `is-left` - left aligns element using flex
41 | * `is-fixed` - fixed positioned element
42 | * `is-paddingless` - removes any padding
43 | * `is-marginless` - removes any margin
44 | * `is-rounded` - make the element round
45 | * `clearfix` - clears the floats
46 | * `is-hidden` - hides the element completely
47 | * `hide-xs` - hides the element for screens <600px
48 | * `hide-sm` - hides the element for screens >=600px and <900px
49 | * `hide-md` - hides the element for screens >=900px and <1200px
50 | * `hide-lg` - hides the element for screens >=1200px
51 | * `hide-pr` - hides the element for printing
52 |
53 |
54 |
--------------------------------------------------------------------------------
/docs_src/src/pages/why_chota.md:
--------------------------------------------------------------------------------
1 | # Why chota?
2 |
3 | When you decide to use [Svelte](https://svelte.dev) in your projects, you expect very tiny bundles of code.
4 |
5 | [chota](https://jenil.github.io/chota/) is a super light-weight CSS framework, which adds only ~3kb of gzipped code to your bundle.
6 |
7 | Svelte-chota is a UI kit for easily using [chota](https://jenil.github.io/chota/) in your [Svelte](https://svelte.dev) projects.
--------------------------------------------------------------------------------
/docs_src/src/static/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexxNB/svelte-chota/0b4d259cec6a88f549fc8197bcf75c10f18aefed/docs_src/src/static/favicon.png
--------------------------------------------------------------------------------
/docs_src/src/static/icons/javascript.svg:
--------------------------------------------------------------------------------
1 |
2 |
64 |
--------------------------------------------------------------------------------
/docs_src/src/static/icons/sprite.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs_src/src/static/icons/svelte.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/docs_src/src/static/overpass-400.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexxNB/svelte-chota/0b4d259cec6a88f549fc8197bcf75c10f18aefed/docs_src/src/static/overpass-400.woff2
--------------------------------------------------------------------------------
/docs_src/src/static/overpass-600.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/AlexxNB/svelte-chota/0b4d259cec6a88f549fc8197bcf75c10f18aefed/docs_src/src/static/overpass-600.woff2
--------------------------------------------------------------------------------
/docs_src/src/theme.css:
--------------------------------------------------------------------------------
1 | /* Theme tunning: for full list ov variables visit the https://alexxnb.github.io/svelte-docs/theming */
2 | @import "./font.css";
3 |
4 | :root{
5 |
6 | --primary: #14854F;
7 | --font: 'Overpass',sans-serif
8 | }
9 |
10 | body{
11 | font-weight: 400;
12 | }
13 |
14 | h1,h2,h3,h4,h5,strong,b{
15 | font-weight: 500;
16 | }
--------------------------------------------------------------------------------
/docs_src/svelte-docs.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | // if you will serve docs in subdirictory use '/subdir/'
3 | basepath: '/svelte-chota/',
4 |
5 | // theme
6 | theme: 'light',
7 |
8 | title: {
9 | // constant part of page title
10 | main: 'Svelte-Chota UI Components',
11 |
12 | // use first header's content as a part of page's title
13 | // it looks for `# Header` and `## Header` on the current page
14 | header: true,
15 | },
16 |
17 | // URL to your favicon
18 | favicon: 'static/favicon.png',
19 |
20 | pathes: {
21 | // directory for files, generated in development mode
22 | dev: '__DOCS__/dev',
23 |
24 | // directory for builted documentaton
25 | build: '__DOCS__/dist',
26 | },
27 |
28 | aliases:{
29 | // Virtual packages
30 | // : ,
31 | //
32 | // Ex1: './Button.svelte': './../dist/Button.svelte',
33 | // Ex2: 'mylib': './../dist/index.js', (don't miss `index` and `.js` at the end!)
34 | //
35 | // Then you can use:
36 | // import Button from './Button.svelte';
37 | // import { Input } from 'mylib';
38 | 'svelte-chota': './../cmp/index.js'
39 | },
40 |
41 | preprocess: [
42 | // preprocessors for Svelte if needed in Examples
43 | // syntax same as for `preprocess` option in `rollup-plugin-svelte`
44 | // Ex: Import preprocessor at top of the config file:
45 | // import {markdown} from 'svelte-preprocess-markdown';
46 | // Then add it here:
47 | // markdown({filetype: 'svelte'}),
48 |
49 | ]
50 |
51 | }
--------------------------------------------------------------------------------
/esbuild.js:
--------------------------------------------------------------------------------
1 | const esbuild = require('esbuild');
2 | const sveltePlugin = require('esbuild-svelte');
3 | const pkg = require('./package.json');
4 |
5 | (async ()=>{
6 | await esbuild.build({
7 | entryPoints: ['cmp/index.js'],
8 | bundle: true,
9 | outfile: pkg.module,
10 | format: 'esm',
11 | minify: true,
12 | external: [
13 | 'svelte',
14 | 'svelte/*'
15 | ],
16 | plugins: [sveltePlugin({compileOptions:{
17 | dev: false,
18 | css: true
19 | }})]
20 | });
21 |
22 | await esbuild.build({
23 | entryPoints: ['cmp/index.js'],
24 | bundle: true,
25 | outfile: pkg.main,
26 | format: 'cjs',
27 | minify: true,
28 | external: [
29 | 'svelte',
30 | 'svelte/*'
31 | ],
32 | plugins: [sveltePlugin({compileOptions:{
33 | dev: false,
34 | css: true
35 | }})]
36 | });
37 | })()
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "svelte-chota",
3 | "module": "dist/index.mjs",
4 | "main": "dist/index.js",
5 | "svelte": "cmp/index.js",
6 | "scripts": {
7 | "docs-dev": "cd ./docs_src && npm run dev",
8 | "docs-build": "cd ./docs_src && npm run build",
9 | "build": "node esbuild",
10 | "prepublishOnly": "npm run build"
11 | },
12 | "keywords": [
13 | "svelte",
14 | "chota",
15 | "svelte ui kit",
16 | "ui",
17 | "ui kit",
18 | "sveltejs"
19 | ],
20 | "files": [
21 | "cmp",
22 | "dist"
23 | ],
24 | "devDependencies": {
25 | "esbuild": "^0.8.31",
26 | "esbuild-svelte": "^0.4.0",
27 | "svelte": "^3.31.2"
28 | },
29 | "description": "Svelte UI components based on super lightweight chota CSS framework.",
30 | "version": "1.8.6",
31 | "repository": {
32 | "type": "git",
33 | "url": "git+https://github.com/AlexxNB/svelte-chota.git"
34 | },
35 | "author": "Alexey Schebelev",
36 | "license": "MIT",
37 | "bugs": {
38 | "url": "https://github.com/AlexxNB/svelte-chota/issues"
39 | },
40 | "homepage": "https://alexxnb.github.io/svelte-chota"
41 | }
42 |
--------------------------------------------------------------------------------